On this page |
Usages ¶
This function acts differently depending if you pass it one or two arguments.
nodeType(category, internal_name)
→ hou.NodeType or None
Where category
is a hou.NodeTypeCategory (not a string), and internal_name
is a string containing the internal name of a node type, which may include a scope, namespace, and/or version.
For example:
nodetype = hou.nodeType(hou.SopNodeTypeCategory(), "acme::rocketboots::2.0")
nodeType(internal_name_with_category)
Where internal_name_with_category
is a string containing the internal name of a node type including the category, which may also include a scope, namespace, and/or version.
For example:
nodetype = hou.nodeType("acme::Sop/rocketboots::2.0")
Tips and notes ¶
-
Do not confuse
hou.nodeType()
(starts with a lower-case N, a function that returns aNodeType
object) withNodeType
(starts with an upper-case N, the class representing node types). -
If you have a
Node
reference to a node in the network, you can get its type object by calling hou.Node.type. -
Each node category has a corresponding function to returns its corresponding hou.NodeTypeCategory object. For example, hou.sopNodeTypeCategory(), hou.objNodeTypeCategory(), hou.lopNodeTypeCategory(), and so on.
-
hou.nodeTypeCategories() returns a
dict
mapping category names toNodeTypeCategory
objects. -
If you have a category object, hou.nodeTypeCategory.nodeType takes the internal name of a node type and returns the corresponding hou.NodeType object. hou.NodeTypeCategory.nodeTypes returns a
dict
mapping internal names to hou.NodeType objects. -
To see the internal name of a node in the network editor, right click the node and choose Type Properties. The internal name (without the type category) is at the top of the window labelled Operator Type.
Examples ¶
# The following four ways of looking up the copy SOP's node type are equivalent: >>> hou.nodeType("Sop/copy") <hou.SopNodeType for Sop copy> >>> hou.nodeType(hou.sopNodeTypeCategory(), "copy") <hou.SopNodeType for Sop copy> >>> hou.nodeType("acme::Sop/rocketboots::2.0") <hou.SopNodeType for Sop acme::rocketboots::2.0> >>> hou.nodeType(hou.sopNodeTypeCategory(), "acme::rocketboots::2.0") <hou.SopNodeType for Sop acme::rocketboots::2.0>
See also |