Node event callbacks let you run code when events occur on an individual node instance. See hou.OpNode.addEventCallback.
For all event types, the callback is called with a node
keyword argument (containing a hou.OpNode reference to the node) and an event_type
argument (containing one of the values below, indicating the type of event that occurred).
Some event types pass additional keyword arguments to the callback function, as noted below.
Values ¶
hou.nodeEventType.BeingDeleted
Runs before a node is deleted. You cannot cancel the deletion.
hou.nodeEventType.NameChanged
Runs after a node was renamed. You can get the new name using hou.Node.name.
hou.nodeEventType.FlagChanged
Runs after one of the node’s flags was turned on or off.
hou.nodeEventType.AppearanceChanged
Runs after the an event occurs that changes what the node looks like in the network editor. This includes but is not limited to:
-
Color or shape changed
-
Error triggered or cleared
-
Selected or deselected
-
Asset locked or unlocked
Extra keyword argument: change_type
(hou.appearanceChangeType)
hou.nodeEventType.PositionChanged
Runs after the node is moved in the network editor. You can get the node’s new position using hou.Node.position.
hou.nodeEventType.InputRewired
Runs after one of the node’s inputs are connected or disconnected.
Extra keyword argument: input_index
(int) – the input number (starting at 0) that changed.
hou.nodeEventType.InputDataChanged
The data changed on an input node that this node depends on. Changes to an input node that is not used (due to a Switch node, for example) will not trigger this callback. Houdini also does not trigger this event when a node changes if that node’s data or parameters are referenced through expressions. Only nodes connected to this node as an input will trigger this callback.
hou.nodeEventType.ParmTupleChanged
Runs after a parameter value changes. You can get the new value using hou.ParmTuple.eval.
Extra keyword argument: parm_tuple
(hou.ParmTuple).
Note
If many/all parameters on the node change at the same time, instead of calling the handler for each one, Houdini will call the handler once with a parm_tuple
argument of None
. Your callback code should handle this possibility.
hou.nodeEventType.ParmTupleAnimated
Runs after a parameter value changes from an undo/redo change or a major animation editor change. It isn’t called during playback. You can get the new value using hou.ParmTuple.eval.
Extra keyword argument: parm_tuple
(hou.ParmTuple).
Note
If many/all parameters on the node change at the same time, instead of calling the handler for each one, Houdini will call the handler once with a parm_tuple
argument of None
. Your callback code should handle this possibility.
hou.nodeEventType.ParmTupleChannelChanged
Runs after a parameter value changes from a minor animation editor change. It isn’t called during playback. You can get the new value using hou.ParmTuple.eval.
Extra keyword argument: parm_tuple
(hou.ParmTuple).
Note
If many/all parameters on the node change at the same time, instead of calling the handler for each one, Houdini will call the handler once with a parm_tuple
argument of None
. Your callback code should handle this possibility.
hou.nodeEventType.ParmTupleLockChanged
Runs after a parameter lock state has changed. You can get the new lock value using hou.Parm.isLocked.
Extra keyword argument: parm_tuple
(hou.ParmTuple).
hou.nodeEventType.ParmTupleEnabledChanged
Runs after a parameter enabled state has changed. You can get the new enabled state value using hou.Parm.isDisabled.
hou.nodeEventType.ParmTupleVisibleChanged
Runs after a parameter visible state has changed. You can get the new visibility value using hou.Parm.isHidden.
hou.nodeEventType.ChildCreated
For a subnet node (for example, a Geometry object), runs after a new node is created inside.
Extra keyword argument: child_node
(hou.OpNode)
hou.nodeEventType.ChildDeleted
For a subnet node (for example, a Geometry object), runs before a node is deleted inside. You cannot cancel the deletion.
Extra keyword argument: child_node
(hou.OpNode)
hou.nodeEventType.ChildSwitched
For a subnet node (for example, a Geometry object), runs after the current node, display flag, or render flag changes inside (meaning the 3D view will change).
Extra keyword argument: child_node
(hou.OpNode) – the newly selected child node.
hou.nodeEventType.ChildSelectionChanged
For a subnet node (for example, a Geometry object), runs after the selection changes inside. The selection can consist of nodes, network boxes, sticky notes, indirect subnet inputs, or network dots. You can get the new selection with hou.Node.selectedItems.
hou.nodeEventType.NetworkBoxCreated
Runs after a new network box is created inside this node.
hou.nodeEventType.NetworkBoxChanged
Runs after an item is added to or removed from a network box inside this node. In some cases is may be possible to receive a NetworkBoxChanged
callback for a new network box before receiving the NetworkBoxCreated
callback.
hou.nodeEventType.NetworkBoxDeleted
Runs right before a network box is deleted from inside this node.
hou.nodeEventType.StickyNoteCreated
Runs after a new network box is created inside this node.
hou.nodeEventType.StickyNoteChanged
Runs after a new sticky note’s text is changed inside this node. In some cases is may be possible to receive a StickyNoteChanged
callback for a new network box before receiving the StickyNoteCreated
callback.
hou.nodeEventType.StickyNoteDeleted
Runs right before a sticky note is deleted from inside this node.
hou.nodeEventType.IndirectInputCreated
Runs after a new indirect input is created inside this node. This will generally be a Network Dot, but may in some cases be a Subnet Indirect Input.
hou.nodeEventType.IndirectInputRewired
Runs after the input connection to an indirect input is changed. Since Subnet Indirect Inputs don’t have input connections, this will only occur on a Network Dot.
hou.nodeEventType.IndirectInputDeleted
Runs before an indirect input is deleted from inside this node. This will generally be a Network Dot, but may in some cases be a Subnet Indirect Input.
hou.nodeEventType.SpareParmTemplatesChanged
Runs after a spare parameter is modified on, added to, or removed from the node.
Note
If the node has spare parameters, this event triggers when any parameter is modified, not just a spare parameter.
hou.nodeEventType.SelectionChanged
Runs after the selection associated with a node changes. This only applies to the geometry selected on a SOP node, or the scene graph primitives selected in a LOP Network.
hou.nodeEventType.CustomDataChanged
Runs after some custom data on a node is changed. The custom data available, and the methods for accessing it, will depend on the hou.NodeType of the node that is changing. One example of custom node data is the viewport scene overrides that can be applied to a LOP Network.
hou.nodeEventType.WorkItemSelectionChanged
For a TOP network, runs after the selected work item has a changed.
Extra keyword argument: work_item_id
- the ID of the selected work item
Extra keyword argument: selected_node
- the selected TOP node, if a selection exists