On this page | |
Inheritance |
|
Overview ¶
You can get a list of NodeConnection
objects from a hou.Node instance
using hou.Node.inputConnections and hou.Node.outputConnections.
Note
It is probably easier to use the hou.Node.inputs and hou.Node.outputs methods (which return the endpoints of a node’s connections) to traverse the network, rather than dealing with the connections themselves.
This object is “read-only”. To create or edit connections, use methods on the node, such as hou.Node.setNamedInput, hou.Node.setInput, hou.Node.setFirstInput, hou.Node.setNextInput, hou.Node.createInputNode, and hou.Node.createOutputNode.
Input and Output meaning ¶
The hou.NodeConnection.outputNode and hou.NodeConnection.inputNode are named in relation to the “input” and “output” ends of the connector. So, outputNode()
returns the node at the “output” end of this connection, in relation to the flow of data through the network. inputNode()
returns the node that provides data to the output node.
For the other methods on this object, if the method name starts with “input”, it is referring to data on the inputNode()
. If the method name starts with “output”, it is referring to data from the outputNode()
. There is one exception to this though: inputIndex()
refers the the input number on the outputNode()
, and outputIndex()
refers to the output number of the inputNode()
.
Methods ¶
outputNode()
→ hou.Node
Return the node on the output side of this connection. This is the node
that the connection goes to, in the direction of data flow. If this
connection has a network dot as its output, this method returns None
.
inputNode()
→ hou.Node
Return the node on the input side of this connection. This is the node
that the connection comes from, in the direction of data flow. If this
connection goes through an indirect input, this will return the node
connected to the parent node (or None
if nothing is connected).
outputIndex()
→ int
Returns the index of the output connection on the node that the input
side of this connections connects to. If this connection goes through an
indirect input, this will return the index of the output connected to the
parent node (or 0
if nothing is connected).
inputIndex()
→ int
Returns the index of the input connection on the node that the output side of this connections connects to.
outputName()
→ str
Returns the name of the input connection on the node that the output side of this connections connects to.
outputLabel()
→ str
Returns the label of the input connection on the node that the output side of this connections connects to.
outputDataType()
→ str
Returns the data type of the input connection on the node that the output side of this connections connects to.
This method only applies to VOP node connections. Raises hou.OperationFailed if invoked on a non VOP node connection.
The string returned by this method can be used to set the Type parameter on a Parameter or Constant VOP.
inputName()
→ str
Returns the name of the output connection on the node that the input side of this connections connects to.
inputLabel()
→ str
Returns the label of the output connection on the node that the input side of this connections connects to.
inputDataType()
→ str
Returns the data type of the output connection on the node that the input side of this connections connects to.
This method only applies to VOP node connections. Raises hou.OperationFailed if invoked on a non VOP node connection.
The string returned by this method can be used to set the Type parameter on a Parameter or Constant VOP.
subnetIndirectInput()
→ hou.SubnetIndirectInput
If this connection has a subnet indirect input connected to it instead of
a node, return the corresponding object. Otherwise, return None
. See
hou.SubnetIndirectInput for information on subnet indirect inputs.
outputItem()
→ hou.NetworkMovableItem
Return the node or network dot on the output side of this connection.
This is the node or dot that the connection goes to, in the direction
of data flow. This method should never return None
.
inputItem()
→ hou.NetworkMovableItem
If this connection has a subnet indirect input connected to it,
return the corresponding hou.SubnetIndirectInput object.
If this connection has a node connected to it, return the corresponding
hou.Node object. Otherwise, return None
. This method is
essentially equivalent to the following:
def getInputItem(node_connection): if node_connection.subnetIndirectInput() is not None: return node_connection.subnetIndirectInput() return node_connection.inputNode()
inputItemOutputIndex()
→ int
Returns zero if this connection has a subnet indirect input connected to
it. Otherwise return the index of the output connection on the node that
the input side of this connections connects to. In combination with the
inputItem
method, node and subnet indirect inputs can be processed
through a common code path for many use cases.
isSelected()
→ bool
Return True
if this connection is selected.
setSelected(selected, clear_all_selected = False)
Selects or de-selects this connection. If the clear_all_selected
parameter is set to True
, all other selections (both connections,
and nodes, network boxes, etc.) will be cleared before this connection
is selected.
Methods from hou.NetworkItem ¶
networkItemType()
→ hou.networkItemType
Return an enum value indicating what type of network item is represented
by this object. This value is equivalent to using the isinstance
built in
Python function with the matching class
(for example hou.networkItemType.Connection is equivalent to
hou.NodeConnection).