Network dots are allowed to have a single input, but may have many outputs. They can be moved around to force a wire connecting two nodes to follow a specific path. They can also be used as "scaffolding" for a set of nodes that you want to be able to quickly add or remove in a larger network.
Sets the boolean pinned state of this dot. Pinned dots are not functionally different from unpinned dots, but are treated differently by the network editor. A pinned dot remains even if its input and output connections are removed. An unpinned dot will be deleted automatically by the network editor if its input or last output is cut.
The following code is a greatly simplified version of the code for automatically deleting unconnected dots, which will delete any dots that are not pinned and that don’t have an input connection:
>>> net = hou.node('/obj') >>> net.createNetworkDot().setPinned(False) >>> net.createNetworkDot().setPinned(True) >>> net.networkDots() (<hou.NetworkDot dot1 in /obj>, <hou.NetworkDot dot2 in /obj>) >>> for dot in net.networkDots(): ... if not dot.isPinned(): ... if dot.inputItem() is None: ... dot.destroy() ... >>> net.networkDots() (<hou.NetworkDot dot2 in /obj>,)
Returns the pinned state of this dot. See hou.NetworkDot.setPinned() for a more detailed discussion of the meaning of a pinned dot.
Connects a network item to the input of this dot. This effectively rewires any nodes that are connected to the output of this dot.
Raises hou.InvalidInput if
output_index is invalid. Raises
item_to_become_input is not in the same
network as this dot. Raises hou.PermissionError if the dot is
inside a locked asset.
setInput(input_index, item_to_become_input, output_index=0)
Connects a network item to the input of this dot, exactly like the two parameter form of this function. But this second signature matches the signature of hou.Node.setInput(), which allows code to run on either a network dot or a node. The value of the input_index is ignored.
insertInput(input_index, item_to_become_input, output_index=0)
Connects a network item to the input of this dot, exactly like the two
parameter form of
setInput. But this method name and signature matches
the signature of hou.Node.insertInput(), which allows code to run on
either a network dot or a node. The value of the input_index is ignored.
→ tuple of hou.NodeConnection
Returns a tuple of hou.NodeConnection objects for the connection coming into this dot. The tuple will have a length of one if anything is connected to the input of this dot. Returns an empty tuple if nothing is connected.
Delete this dot. Connections in and out of the dot are automatically re-established such that the behavior of the network will be unchanged by the removal of this dot.
Methods from hou.NetworkItem
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
Methods from hou.NetworkMovableItem
Return this node’s name. See also hou.NetworkMovableItem.path().
Set the name of this node. Raises hou.OperationFailed if the new name contains characters other than letters, numbers, periods, dashes, or underscores. Raises hou.OperationFailed if the node could not be renamed (for example, another node already exists with the name, the node is the root node or top-level manager (e.g. /obj), or the node is inside a locked asset). If the unique_name parameter is set to True, the supplied name may be changed to ensure that it doesn’t match the name of any existing node.
Return the value of the last set of digits inside the node’s name, or 0 if there are no digits.
For example, the result is
102 for a node named
a node named
Return the full path (i.e. starting with
/) of this node in the network.
Return a relative path to another node object from this node.
>>> box1 = hou.node("/obj/box_object1/box1") >>> sphere1 = hou.node("/obj/sphere_object1/sphere1") >>> box1.relativePathTo(sphere1) '../../sphere_object1/sphere1' >>> hou.node("/obj").relativePathTo(box1) 'box_object1/box1' >>> box1.relativePathTo(box1) '.'
Return the node that contains this item.
Note that this method returns None if the item is the root node (i.e.
>>> hou.node("/obj/box_object1").parent() <hou.Node at /obj> >>> print hou.node("/").parent() None
→ hou.NetworkBox or
Returns the parent network box which contains this item, or None if it is not inside a network box.
Return whether this item is selected.
See also hou.selectedNodes().
Equivalent to calling hou.NetworkMovableItem.isSelected().
setSelected(on, clear_all_selected=False, show_asset_if_selected=False)
Select or deselect this item, optionally deselecting all other selected
items in this network. If
show_asset_if_selected is True, and this item
Node, then the panes will show the top-level asset of the selected
Equivalent to calling hou.NetworkMovableItem.setSelected() with default values for all optional parameters.
Return the color of this item’s tile in the network editor.
Sets the color of this item’s tile in the network editor to the given hou.Color.
Returns an integer value that uniquely identifies this item
in a given Houdini session. This id is only guaranteed to be unique
in a single Houdini process. It is useful as a quick and easy way to
save a restore a reference to an item. It is also only unique for
a specific item subclass. So there may be a
Node with the same
session id as a
See hou.nodeBySessionId() to turn a session id back into a node, or hou.networkBoxBySessionId() to turn a session id back into a network box, or more generally, hou.itemBySessionId() to turn a session id combined with an enum value indicating the item subclass into an item of that type.
Return the position of this item’s tile in the network editor graph as
Vector2. See also
Sets the position of this item’s tile in the network editor graph. Raises hou.InvalidInput if the item cannot have the given position.
Moves this item’s tile in the network editor graph by the increments in the given hou.Vector2.
To position a item absolutely, use
To get the item’s current graph position, use
Raises hou.InvalidInput if the item cannot move to the position specified.
Equivalent to calling hou.NetworkMovableItem.move().
Return the size of this item’s tile in the network editor graph as a
Methods from hou.IndirectInput
Return the nodes that have one of their inputs connected to the output of this object.
Return a tuple of objects representing each connection to a node from the output of this object. The objects returned by this method allow you to discover not just which nodes are connected to this object, but which inputs it feeds into.
Return the node on the input side of this indirect input. If this
input comes through another indirect input, this function will recurse
through that indirect input until it finds a node. If no node is
connected, even indirectly,
None will be returned. Note that the
returned node may not be inside the same parent network as this object
if the method traverses up through a hou.SubnetIndirectInput.
Returns the index of the output connection on the node that the input
side of this object connects to. As with the
input function, indirect
inputs are traversed until a node is found. If no node is connected, even
0 will be returned.
Returns the item connected directly to the input side of this indirect
input. This may be a node, indirect input, or
None if nothing is
connected. Note that the returned item may not be inside the same parent
network as this object if it is a hou.SubnetIndirectInput.
Returns the index of the output connection on the network item connected
directly to the input side of this object. Returns
0 if nothing is
connected. This value will only be non-zero if a hou.Node is
connected to this object since all other network items only has a single
Sets the color of this object to be the default for indirect inputs. By
explicitly setting to the default color, any future changes to the default
indirect input color will cause this object to use the new color. This
method clears the
symbolicColorName setting and the
Sets the color of this object to use a symbolic color name defined in the
current Houdini color scheme (see hou.ui.colorByName). The symbolic
color name will be saved with the hip file so that changes to the color
scheme will result in a new color being used for this object. This
method clears the
useColorFromDefault setting, and causes the
color value to be ignored.
Set this indirect input to display itself with the same color as the
first input connector connected as an output to this object. If set to
False, this object is displayed with its color returned by the
hou.NetworkMovableItem.setColor() method. This method clears the
symbolicColorName setting, and causes the
color value to be ignored.
Return the symbolic color name used to display this object, set with the
setSymbolicColorName method. Returns an empty string if the color of
this object was set using the
hou.NetworkMovableItem.setColor() methods. The symbolic color name
can be converted to a hou.Color using hou.ui.colorFromName.
True if this object will be displayed based on the color of the
first input to which it is connected. Return
False if will be displayed
using the color return by the :hou.NetworkMovableItem.color method.