Houdini 21.0 Nodes APEX nodes

component::AddControlAction

Adds a callback to a control for a specific interaction.

On this page
Since 21.0

Adds a control action to a control. Control actions are additional behaviors that are triggered when interacting with the control. For example, selecting a control can trigger a change in the visibility of other controls. A control action can also be a custom Python callback.

The graph and control ports of this node are in-place ports, which means the graph and control are updated without creating a copy.

Inputs

*graph: ApexGraphHandle Required

The graph that contains the control.

*control: ApexNodeID Required

The control to extend with an action.

trigger: String

The control interaction that triggers the action.

Trigger

Description

box_selected

Triggers the action if the control is box selected.

drag

Runs the action constantly during a control drag if the control is the primary control.

Warning

This can have a negative impact on performance.

enddrag

Triggers the action if the control is the primary control at the end of a mouse drag.

scroll

Triggers the action after a mouse wheel event.

selection

Triggers the action immediately after a control is selected as a single selection, similar to a button click.

startdrag

Triggers the action if the control is the primary control right before the user starts dragging it.

action: String

The action to execute after the trigger.

Action

Description

pinchannels

Pins the animation channels of a number of controls in the animation editor. The controls are provided in the pattern input port as an APEX path pattern. Triggering this action again unpins the animation channels.

python

Executes a custom Python snippet provided in the pythonsnippet input port. The Python callback has automated bindings to the animate state through the following variables:

  • apex: The APEX module.

  • state: The APEX animate state module.

  • device: The UIEvent device class that allows you to fetch information about modifier keys.

  • hou: The standard Houdini Python module.

select

Selects a number of controls after the control interaction. The controls are provided in the pattern input port as an APEX path pattern.

setvisible

Toggles the visibility of a number of controls. This is similar to updating the controls' visilibility in selection sets. The controls are provided in the pattern input port as an APEX path pattern.

snap

Performs a space switch snap operation using the mappings in mapping_a and mapping_b. These mappings define the transform mappings, and enableparm determines the mapping that is active.

pattern: String

An APEX path pattern that specifies the target controls that are used for the select, setvisible, and pinchannels actions in the action input port.

mapping_a: Dict

The first space switch mapping for the snap action.

mapping_b: Dict

The second space switch mapping for the snap action.

parm: String

The parameter name used by the snap and pinchannels actions.

enableparm: String

The enable parameter name for the snap action. For setups like space switches, this defines if mapping_a or mapping_b is used.

pythonsnippet: String

The custom Python code to execute when using the python action.

reset_a: StringArray

An array of control-channel name pairs that are reset to default values when using mapping_a with the snap action.

reset_b: StringArray

An array of control-channel name pairs that are reset to default values when using mapping_b with the snap action.

setparmvalue: Bool

If set to True, sets the parameter value for the snap action parameter defined by enableparm. Defaults to True.

Outputs

*graph: ApexGraphHandle

Pass-through of the input graph.

*control: ApexNodeID

The control node with the updated properties.

See also

APEX nodes