User guide

170
switchOutput = switch.getOutputPort( "output" )
# Create a Render node at root level
render = NodegraphAPI.CreateNode( 'Render', root )
renderInput = render.getInputPort( "input" )
# Connect the primitie to the switch, and switch to render
primitive1Out.connect( switchInput1 )
primitive2Out.connect( switchInput2 )
switchOutput.connect( renderInput )
# Get the logical input of the render.input port
TIME = 0.0
inputSource = render.getInputSource( "input", TIME )
PORT_INDEX = 0
inputPort = inputSource[ PORT_INDEX ]
# Get hold of the source node so that we can print its name.
inputNode = inputPort.getNode()
inputNodeName = inputNode.getName()
# Print the name of the source node
print( inputNodeName )
User Parameters
You can add custom User Parameters to a node, allowing nodes to be tagged with additional information. This ability
to add User Parameters is particularly useful when creating Macros and Super Tools with a custom UI. For more
information on Macros and Super Tools, and uses for User Variables, please see Groups, Macros, and Super Tools,
and for a list of all available User Parameter types and widgets please see User Parameters and Widget Types.
User Parameters are defined from the following basic types, and their behavior is dictated by their assigned widget:
Group
Containers for one or more other User Parameters, including other groups. Requires a name argument.
Number
A single float. Requires a default value argument.
Number Array
An array of floats. Requires name and size arguments.
String
A single string object. Requires a default value argument.
23 NODEGRAPH API | USER PARAMETERS