Inheritance |
|
This class specializes the generic hou.NodeType class for Houdini OP node types. This subclass adds information about digital assets, instances, and registration information that is specific to Houdini’s OP node types.
A digital asset can define a node type. In this case the nodes contained inside the asset’s definition implement the node type’s algorithm, and you can customize the parameters in the node type using the Type Properties dialog,
Methods ¶
instances()
→ tuple
of hou.Node
Return a tuple of all the nodes of this type in the current scene.
sectionData(section_name)
→ str
Return the data stored in the specified section of the HDA definition corresponding to this node type. If the HDA definition doesn’t contain the specified section or this node type doesn’t correspond to a digital asset, return an empty string.
binarySectionData(section_name)
→ bytes
Only available in Python 3.
Return a bytes
object containing the data stored in the specified section
of the HDA definition corresponding to this node type. Ideal for sections
containing binary data. If the HDA definition doesn’t contain the
specified section or this node type doesn’t correspond to a digital asset,
return an empty bytes
object.
hasSectionData(section_name)
→ bool
Return True if this node type corresponds to a digital asset whose definition contains the section. Otherwise, return False.
definition()
→ hou.HDADefinition
If this node type corresponds to a digital asset, return the hou.HDADefinition. Otherwise, return None.
allInstalledDefinitions()
→ tuple
of hou.HDADefinition
Search all installed operator type libraries and return a tuple of available hou.HDADefinition objects providing definitions for this node type.
Houdini allows multiple otl files to be loaded at the same time that each contain definitions for the same node type. The definition in use is called the current definition. See also hou.HDADefinition.isCurrent.
hdaModule()
→ hou.HDAModule
Return the HDAModule object for this node type. If the type is not for a digital asset, the module is empty. Otherwise, the module contains the functions, constants, classes, etc. in the user-defined “PythonModule” section of the digital asset.
You can use hou.Node.hdaModule as a shortcut to access the HDAModule from a node instance.
See hou.HDAModule for more information.
hdaViewerStateModule()
→ hou.HDAViewerStateModule
This method creates an instance of hou.HDAViewerStateModule for this node type. Returns an empty object if the type is not for a digital asset.
See also hou.Node.hdaViewerStateModule.
hdaViewerHandleModule()
→ hou.HDAViewerHandleModule
This method creates an instance of hou.HDAViewerHandleModule for this node type. Returns an empty object if the type is not for a digital asset.
See also hou.Node.hdaViewerHandleModule.
defaultState()
→ str
Return a string with the name of the default viewer state for controlling nodes of this type. Returns an empty string if the node type doesn’t have an associated viewer state registered.
source()
→ hou.nodeTypeSource enum value
Return a hou.nodeTypeSource enumerated value to indicate if this node type is implemented in VEX, RSL, or the HDK (in C++), or if it is a built-in node type that ships with Houdini.
>>> obj_cat = hou.objNodeTypeCategory() >>> sop_cat = hou.sopNodeTypeCategory() >>> hou.nodeType(obj_cat, "biped_auto_rig").source() nodeTypeSource.Subnet >>> hou.nodeType(sop_cat, "mountain").source() nodeTypeSource.VexCode
sourcePath()
→ str
Return the path to the source for this node type, or "Internal"
if it
is a built-in node type. If the node was created using the HDK, return
the path to the shared object/dll for the node type.
>>> obj_cat = hou.objNodeTypeCategory() >>> hou.nodeType(obj_cat, "biped_auto_rig").sourcePath() 'oplib:/Object/biped_auto_rig?Object/biped_auto_rig' >>> hou.nodeType(obj_cat, "geo").sourcePath() 'Internal'
sourceNetwork()
→ hou.Node or None
If this node type is a digital asset, return the Node instance whose contents define the digital asset. Otherwise, return None.
uninstallFromPath()
Remove this node and any references to it from a particular filesystem installation path. For example, this method will remove vex files, icons, dialog scripts, help cards, etc. for custom installed old-style non-otl node types.
If you call this method on built-in node types, it will have no effect.
node_type.uninstallFromPath(hou.homeHoudiniDirectory())
See also hou.hda.uninstallFile and hou.HDADefinition.destroy.
aliases()
→ tuple
of str
Return all current aliases for this node type. See hou.NodeType.addAlias for an example.
addAlias(alias)
Add an alias for this node type. You can use this alias when creating new nodes.
>>> geo_type = hou.nodeType(hou.objNodeTypeCategory(), "geo") >>> geo_type.addAlias("transformable") >>> geo_type.aliases() ('transformable',) >>> hou.node("/obj").createNode("transformable") <hou.ObjNode of type geo at /obj/geo1>
removeAlias(alias)
Remove an alias for this node type.
setHidden(hidden)
Set whether or not this node type appears in the tab menu. See also hou.NodeType.hidden.
deprecated()
→ bool
Return whether or not this node type has been marked deprecated. See also hou.NodeType.deprecationInfo.
deprecationInfo()
→ dict
of str
to str
or hou.NodeType
If the node type has been marked deprecated, this call will return the deprecation information as a dictionary.
The currently supported keys are:
'version'
The version of Houdini where this operator got deprecated. The form is either major.minor, or major.minor.build (e.g. 14.0 or 14.5.122). This item is always present.
'new_type'
The new node type this node was replaced with. This can be used to create a system of automatic node replacement.
'reason'
This lists the reason given for the deprecation, in case there is no new node to replace with.
Methods from hou.NodeType ¶
name()
→ str
Return the name of this node type. For example, for the geometry object type, the name is “geo”. The name and the node type category together uniquely identify a node type.
nameComponents()
→ tuple
of str
Returns a tuple of node type name components that constitute the full node type name. The components in the tuple appear in the following order: scope network type, node type namespace, node type core name, and version.
# parse the full name into components >>> node_type = hou.nodeType(hou.dopNodeTypeCategory(), 'pyrosolver::2.0') >>> node_type.nameComponents() ('', '', 'pyrosolver', '2.0')
nameWithCategory()
→ str
Return the name of the node type, prefixed with the name of the node
type category. For example, for the geometry object, this function
returns "Object/geo"
. The category name and type name together
uniquely identify a node type.
>>> hou.nodeType(hou.objNodeTypeCategory(), "geo").nameWithCategory() 'Object/geo'
namespaceOrder()
→ tuple
of str
Returns a node type name list sorted in the descending namespace precedence order. The node types in the list have the same base type as this node type. They have different namespace and/or version.
Houdini uses this list when resolving an unqualified type name in
hou.Node.createNode()
; it will use the first entry in that list that
matches the name specified in the function.
# parse the full name into components >>> node_type = hou.nodeType(hou.dopNodeTypeCategory(), 'pyrosolver') >>> node_type.namespaceOrder() ('pyrosolver::2.0', 'pyrosolver')
description()
→ str
Return the description of this node type that appears in the tab menu.
For example, for the geometry object, the description is "Geometry"
.
This description is also called the operator label in Houdini.
category()
→ hou.NodeTypeCategory
Return the node type category for this node type. For example, for the geometry object, the result is the object returned by hou.objNodeTypeCategory().
parmTemplateGroup()
→ hou.ParmTemplateGroup
Return the group of parm templates corresponding to this node type’s parameter interface.
See hou.ParmTemplateGroup for more information on parm template groups. To change the parameter interface for a node type defined by a digital asset, see hou.HDADefinition.setParmTemplateGroup.
parmTemplates()
→ tuple
of hou.ParmTemplate
Return a tuple of parm templates for the parameters on this node type. Note that spare parameters on individual node instances are not included in this tuple, since they are independent from the node type.
minNumInputs()
→ int
Return the minimum number of inputs that nodes of this type can have. If these inputs are not connected, the node will generate an error.
maxNumInputs()
→ int
Return the maximum number of inputs that nodes of this type can have. Return 9999 if this node type can accept an unlimited number of inputs (e.g. the merge SOP).
maxNumOutputs()
→ int
Return the maximum number of outputs that nodes of this type can have. Most node types have only one output, but some, like the split dop, can have multiple.
hasEditableInputData()
→ bool
Return True if nodes of this node type allow the user to associate data with each input to the node. The purpose of this data may vary from one node type to another. This data can be accessed with methods such as hou.Node.editableInputName and hou.Node.setEditableInputName.
hasPermanentUserDefaults()
→ bool
Returns whether a user has set permanent defaults for this node type.
See also hou.Parm.hasTemporaryDefaults
hasUnorderedInputs()
→ bool
Return whether it is impossible for this node type to have gaps in its connected inputs. For example, the cookie SOP has two inputs, and it’s possible for only the second input to be connected, so this method would return False. However, the merge SOP cannot have any gaps in its inputs, so this method would return True.
See also hou.Node.inputs, hou.Node.inputConnections, and hou.Node.inputConnectors.
isGenerator()
→ bool
Return if this node type has been flagged as a generator. For example, a grid SOP generates new geometry, while a subdivide SOP does not, and instead processes the geometry passed into it. See also hou.NodeType.minNumInputs.
isManager(include_management_types=True)
→ bool
Return whether this NodeType is a manager. The manager node instances are
/obj
, /out
, /part
, /ch
, /shop
, /img
, and /vex
.
If include_management_types
is set to True then this method will
additionally return True if this node type is a management node type such
as a SHOP network, or VOP network, etc.
icon()
→ str
Return the name or path of the icon for this node type. Note that node types that ship with Houdini use a name instead of a full path, and Houdini uses its search path to locate the icon with that name.
isReadable()
→ bool
Return True if this node type is readable and False otherwise. A readable node type is one that you can create node instances from.
isWritable()
→ bool
Return True if this node type is writable and False otherwise. A writable node type is one that you can make changes to.
areContentsViewable()
→ bool
Return True if the node network contained in the node type is viewable and False otherwise.
containedNodeTypes()
→ tuple
of str
Return a tuple of all NodeType names of the contents of an HDA.
childTypeCategory()
→ hou.NodeTypeCategory or None
Return the NodeTypeCategory for this NodeType’s children, or None
if
this NodeType doesn’t allow children.
embeddedHelp()
→ str
Return the help text embedded in this node type. Return an empty string if no embedded help exists.
The embedded help is searched for in two different places in the following order:
-
If an HDK node, the text given by its
OP_Operator::getHDKHelp()
override -
If an HDA node, the corresponding result of hou.HDADefinition.embeddedHelp()
helpUrl()
→ str
Return the URL where the node type stores the documentation, e.g., a file name or an HDA section path. May return an empty string if node type does not know where the documentation is.
defaultHelpUrl()
→ str
Return a generic URL that the help system will try to resolve to the actual location that stores the node type documentation. The generic URL is in the form “operator:table/optypename” and may include additional information such as a namespace or a version.
defaultColor()
→ hou.Color
Return the color used to display a node of this type in the network view if the node’s hou.nodeFlag.ColorDefault flag is set.
setDefaultColor(color)
Set the color used to display a node of this type in the
network view if the node’s hou.nodeFlag.ColorDefault flag is set.
Pass None as the color
parameter to remove the type-specific default.
defaultShape()
→ str
Return the name of the shape used to display a node of this type in the network view if no shape is explicitly assigned to the node.
setDefaultShape(shape)
Set the name of the shape used to display a node of this type in the
network view if no shape is explicitly assigned to the node.
Pass None as the shape
parameter to remove the type-specific default.