User guide
167
NodegraphAPI.SetNodePosition( primitiveGroup,\
primitivePosition )
# Get the output port on the PrimitiveCreate
primitiveGroupOut = primitiveGroup.getOutputPort( "out" )
# Create a merge node at group level
mergeOne = NodegraphAPI.CreateNode( 'Merge', group )
# Add two inputs and get the output ports
mergeOneIn0 = mergeOne.addInputPort( "in0" )
mergeOneIn1 = mergeOne.addInputPort( "in1" )
mergeOneOut = mergeOne.getOutputPort( "out" )
# Connect the PrimitiveCreate out to Merge in0
mergeOneIn0.connect( primitiveGroupOut )
# Connect the Merge node to the Group inputs and outputs
mergeOneIn1.connect( groupIn )
mergeOneOut.connect( groupOut )
Anything connected to the input of the Group node is now merged with the output of the PrimitiveCreate node
contained in the group.
EXPERIMENT: Try creating another PrimitiveCreate node, of a different primitive type, outside the Group.
Connect the output of the new node to the input of the group. View the result to see the outputs of both
PrimitiveCreate nodes together.
Physical and Logical Connections
Conceptually, a port has two forms of connection, Physical and Logical.
Physical Connection
A physical connection is determined directly by what output ports any given input port is connected to in the user
interface. The physical connections are those you see represented by connection arrows in the Node Graph.
Logical Connection
Logical connections are those used to traverse up the Node Graph at render time. Conditional logic, parameter
values and time are used to determine the next relevant source of data, and this is represented by a logical
connection between the current node and the next.
23 NODEGRAPH API | PHYSICAL AND LOGICAL CONNECTIONS