Node event callbacks let you run code when events occur on an individual node instance. See hou.Node.addEventCallback().
For all event types, the callback is called with a node
keyword argument (containing a hou.Node reference to the node) and an event_type
argument (containing one of the values below, indicating the type of event that occured).
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
.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
.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 be handle this possibility.
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.Node)
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.Node)
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.Node) – the newly selected child node.
hou.nodeEventType
.ChildSelectionChanged
For a subnet node (for example, a Geometry object), runs after the selection changes inside. You can get the new selection with hou.Node.selectedChildren().
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.