Inheritence |
|
To create a network box, use the hou.Node.createNetworkBox() method on the node inside which you want to create the box. To get an existing network box, use the hou.Node.findNetworkBox() method on the node containing the network box. To get a list of all network boxes in a network, use the hou.Node.networkBoxes() method on the containing node.
Methods
addItem(item)
Adds a hou.NetworkMovableItem of any kind to the network box.
addNetworkBox(netbox)
Adds a hou.NetworkDot to the network box. This method is deprecated. Use hou.NetworkBox.addItem() instead.
addNode(node)
Adds a hou.Node to the network box. This method is deprecated. Use hou.NetworkBox.addItem() instead.
addStickyNote(stickynote)
Adds a hou.StickyNote to the network box. This method is deprecated. Use hou.NetworkBox.addItem() instead.
addSubnetIndirectInput(indirect)
Adds a hou.SubnetIndirectInput to the network box. This method is deprecated. Use hou.NetworkBox.addItem() instead.
asCode(brief=False, recurse=False, save_box_contents=False, save_channels_only=False, save_creation_commands=False, save_keys_in_frames=False, save_parm_values_only=False, save_spare_parms=False, function_name=None) -> string
Prints the Python code necessary to recreate a network box.
See hou.Node.asCode() for information on the keyword arguments.
autoFit()
→ bool
Returns the value of the auto fit flag on this network box.
comment()
→ str
Returns the comment for this network box.
destroy(destroy_contents=False)
Remove and delete the network box, optionally deleting the nodes it contains.
fitAroundContents()
Resizes the network box to fit its contents.
isMinimized()
→ bool
Returns whether the network box is minimized.
items(recurse=True)
→ tuple
of hou.NetworkMovableItem
Returns the items of any type inside the network box.
recurse
If True, recurses down into nested network boxes.
minimizedSize()
→ hou.Vector2
Return the size of this item’s tile in the network editor graph if it is
minimized. Returned as a Vector2
.
nodes(recurse=True)
→ tuple
of hou.Node
Returns the nodes inside the network box.
recurse
If True, recurses down into nested network boxes.
networkBoxes(recurse=True)
→ tuple
of hou.NetworkBox
Returns the network boxes inside the network box.
recurse
If True, recurses down into nested network boxes.
removeAllItems()
Removes all items from the network box.
removeAllNodes()
Removes all nodes from the network box. This method if deprecated. Use hou.NetworkBox.removaAllItems or hou.NetworkBox.removeItems instead.
removeItem(item)
Removes the given item from the network box.
removeNetworkBox(netbox)
Removes the given network box from the network box. This method if deprecated. Use hou.NetworkBox.removaItem instead.
removeNode(node)
Removes the given node from the network box. This method if deprecated. Use hou.NetworkBox.removaItem instead.
removeStickyNote(stickynote)
Removes the given sticky note from the network box. This method if deprecated. Use hou.NetworkBox.removaItem instead.
removeSubnetIndirectInput(indirect)
Removes the given indirect input from the network box. This method if deprecated. Use hou.NetworkBox.removaItem instead.
resize(vector2)
Resizes a network box by the increments in the given hou.Vector2.
Use setSize()
to set the box’s absolute size.
restoredSize()
→ hou.Vector2
Return the size of this item’s tile in the network editor graph if it is
not minimized. Returned as a Vector2
.
setAutoFit(auto_fit)
Set the value of the auto fit flag on this network box. The default value
is True
which causes the network box to resize itself when nodes that
belong to the network box are moved outside the bounds of the box.
Setting this values to False
prevents this automatic resizing. The
Network View will draw the network box around it’s contents in any case.
The default setting of True
is primarily useful for backward
compatibility with the old network editor which relies on this
automatic resizing to draw the network box properly.
setBounds(bounds)
Sets the size and position of this network box to the given
hou.BoundingRect bounds
parameter. Similar to calling setSize
then setPosition
, but the contents of the network box are not moved.
The supplied bounds are expanded if necessary to contain the box’s
children.
setComment(comment)
Set the comment string for this network box. This comment is visible in the network editor and can be used to describe the purpose of the box.
setMinimized(on)
Minimizes or restores the network box.
setSize(size)
Sets the size of this network box to the given hou.Vector2
size
parameter. Use resize()
to set the box’s size relative to
its current size.
stickyNotes(recurse=True)
→ tuple
of hou.StickyNote
Returns the sticky notes inside the network box.
recurse
If True, recurses down into nested network boxes.
subnetIndirectInputs(recurse=True)
→ tuple
of hou.SubnetIndirectInput
Returns the subnet indirect inputs inside the network box.
recurse
If True, recurses down into nested network boxes.
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).
Methods from hou.NetworkMovableItem
name()
→ str
Return this node’s name. See also hou.NetworkMovableItem.path().
setName(name, unique_name=False)
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.
digitsInName()
→ int
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 geo102
, and 34
for
a node named light12to34
.
path()
→ str
Return the full path (i.e. starting with /
) of this node in the network.
relativePathTo(base_node)
→ str
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) '.'
parent()
→ hou.Node
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
parentNetworkBox()
→ hou.NetworkBox or None
Returns the parent network box which contains this item, or None if it is not inside a network box.
isSelected()
→ bool
Return whether this item is selected.
See also hou.selectedNodes().
isPicked()
→ bool
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
is a Node
, then the panes will show the top-level asset of the selected
item instead.
setPicked(on)
Equivalent to calling hou.NetworkMovableItem.setSelected() with default values for all optional parameters.
color()
→ hou.Color
Return the color of this item’s tile in the network editor.
setColor(color)
Sets the color of this item’s tile in the network editor to the given hou.Color.
sessionId()
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 NetworkBox
.
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.
position()
→ hou.Vector2
Return the position of this item’s tile in the network editor graph as
a Vector2
. See also move()
and setPosition()
.
setPosition(vector2)
Sets the position of this item’s tile in the network editor graph. Raises hou.InvalidInput if the item cannot have the given position.
move(vector2)
Moves this item’s tile in the network editor graph by the increments in the given hou.Vector2.
To position a item absolutely, use setPosition()
.
To get the item’s current graph position, use position()
.
Raises hou.InvalidInput if the item cannot move to the position specified.
shiftPosition(vector2)
Equivalent to calling hou.NetworkMovableItem.move().
size()
→ hou.Vector2
Return the size of this item’s tile in the network editor graph as a
Vector2
.
Replaces |