User guide

159
Node Naming
Each node has a name, which is unique within the bounds of a Katana recipe. Name-spacing does not exist for node
names, which means that a call to:
node = NodegraphAPI.GetNode( 'PrimitiveCreate' )
node.setName( name="Teapot" )
print ( node.getName() )
It may not behave as expected if the chosen name is already in use by another node in the scene. In that case
setName() finds a similar - but unique - name, uses that, and returns the new unique node name.
It’s possible to store a string user attribute on a node that utilities can search for in order to reference a node in a
smaller context. This is a simple pattern that can provide a more localized pseudo node name. See User Parameters
for more on adding User Parameters.
Getting the Parameters of a Node
The parameters of a node are organized in a tree inside the node. The tree allows better organization of nodes with
many parameters, avoids parameter name collisions, and makes it simple to construct more complex re-usable
parameter definitions.
The function getParameters() returns the root parameter of a node. The children of that root parameter are the
top level entries you see in the Parameters tab. For example, to get the children of the root parameter on a node
enter:
for p in node.getParameters().getChildren():
print( p )
Which - assuming node is a reference to a PrimitiveCreate node - prints the following:
<Parameter 'name'>
<Parameter 'type'>
<Parameter 'fileName'>
<Parameter 'previewTexture'>
<Parameter 'previewAlpha'>
<Parameter 'enableClippingPlane'>
<Parameter 'reverseClippingDirection'>
<Parameter 'transform'>
<Parameter 'makeInteractive'>
<Parameter 'includeBounds'>
<Parameter 'viewerPickable'>
You can get a complete text dump of all parameters on a node using getXML(). For example, to see the XML
structure of all the parameters on a node referenced by node enter the following:
23 NODEGRAPH API |