hou.ShopNode class

The base class for all SHOP nodes in Houdini. An instance of this class corresponds to exactly one instance of a node in Houdini.

Inheritence: hou.Node >

See hou.Node for more information.

Methods

Methods inherited from hou.Node: evalParm, createNode, move, clearParmAliases, inputAncestors, reorderChildrenToEnd, childTypeCategory, children, isInsideLockedHDA, appendComment, addSpareParmTuple, findNetworkBox, fileReferences, relativePathTo, color, removeSpareParmTuple, saveToGallery, __getitem__, indirectInputs, modificationTime, inputConnectors, saveOldStylePresetsFile, loadOldStylePresetsFile, findNetworkBoxes, asXML, runInitScripts, cook, permissions, hdaModule, copyNetworkBox, outputConnections, name, parmsInFolder, parmTuplesInFolder, saveCookCodeToFile, nodeGroups, creator, setNextInput, replaceSpareParmTuple, loadChildrenFromFile, loadPresets, findStickyNotes, setCurrent, moveToGoodPosition, findOrCreateMotionEffectsNetwork, selectedChildren, errors, hide, addPermissions, removePermissions, isSelected, isLocked, extractAndDelete, setPermissions, createStickyNote, isBuiltExplicitly, __ne__, expressionLanguage, stickyNotes, parmTuples, parent, matchCurrentDefinition, __setitem__, isCurrent, path, setPosition, setDeleteScript, setExpressionLanguage, messages, createDigitalAsset, asCode, comment, setSelected, outputConnectors, setInput, saveCompiledCookCodeToFile, reorderChildrenToBeginning, parms, size, parmAliases, extraInputs, reorderChildrenAfter, allowEditingOfContents, layoutChildren, deleteScript, isHidden, fileReferencePatterns, spareParms, setName, outputs, parm, extraOutputs, setCreatorState, isTimeDependent, __eq__, networkBoxes, setColor, info, type, parmToNodeReferences, creationTime, referencedNodes, removeSpareParmFolder, _getArgumentAutoComplete, motionEffectsNetworkPath, insertInput, setFirstInput, addNodeGroup, creatorState, addSpareParmFolder, nodeGroup, collapseIntoSubnet, findStickyNote, parmTuple, copyStickyNote, destroy, changeNodeType, evalParmTuple, node, inputs, digitsInName, warnings, saveChildrenToFile, glob, matchesCurrentDefinition, findParms, createNetworkBox, stampValue, reorderChildrenBefore, setBuiltExplicitly, setComment, allSubChildren, recursiveGlob, sessionId, inputConnections, position

definingVopNetNode(self)hou.VopNetNode or None

If this SHOP is defined by a VOP network, return the hou.VopNetNode that defines it. Otherwise, return None.

shaderName(self, as_otl_path=True)str

Return the name of the shader inside this SHOP. If as_otl_path is True, returns an opdef: path to the SHOP type.

shaderString(self, render_type=None)str

Return the shader string generated by this shader for the given render type. This string is written to the file that is read in by the renderer.

render_type

A string representing the renderer. If this string is empty or is "*", Houdini uses the default render type for this shader. Possible render types include "VMantra" (Mantra), "RIB" (RenderMan), "MI" (MentalRay), "OGL" (OpenGL), "OGL2" (OpenGL 2), and "I3D" (Image 3D).

You can use hou.ShopNodeType.renderMask to determine the render types supported by this SHOP’s type. You can also use hou.ShopNodeTypeCategory.renderers to get all the possible render types. Note that some SHOP types, like the properties SHOP or the switch SHOP, have a render mask of "*" to indicate that they will work with any shader type.

If you pass in an unknown or unsupported render type, this method returns an empty string.

>>> for node_type_name in ("v_plastic", "ri_matte", "mib_illum_phong"):
...     hou.node("/shop").createNode(node_type_name)

<hou.ShopNode of type v_plastic at /shop/v_plastic1>
<hou.ShopNode of type ri_matte at /shop/ri_matte1>
<hou.ShopNode of type mib_illum_phong at /shop/mib_illum_phong1>

>>> for shop in hou.node("/shop").children():
...     for render_type in shop.type().renderMask().split():
...         print shop.name(), "supports", render_type
...         print "    shader_string:", shop.shaderString(render_type)
...         print
v_plastic1 supports VMantra
    shader_string: opdef:/Shop/v_plastic

v_plastic1 supports OGL
    shader_string: /shop/v_plastic1

ri_matte1 supports RIB
    shader_string: "matte"

ri_matte1 supports OGL
    shader_string: /shop/ri_matte1

mib_illum_phong1 supports MI
    shader_string: "base.mi/mib_illum_phong" ( "ambience" 0 0 0, "ambient" 1 1 1, "diffuse" 1 1 1, "specular" 1 1 1, "exponent" 20, "mode" 4, "lights" [""] )

mib_illum_phong1 supports OGL
    shader_string /shop/mib_illum_phong1
shaderType(self)hou.shaderType enum value

Returns a hou.shaderType indicating the type of this shader.

Note that this method is a shortcut for self.type().shaderType(), which calls hou.ShopNodeType.shaderType.

supportedRenderers(self) → tuple of str

Returns a list of strings describing the renderers this shader supports.