Houdini 21.0 Nodes APEX nodes

component::AddControlAction 1.0

Adds a callback to a control for a specific interaction.

On this page
Since 21.0

Adds a Control Action Callback to a given control. Control actions are additional behaviors that are triggered when interacting with the control. A selection of a control can for example trigger a change in visibility of a group of other controls. A control action can also be a custom Python callback. Using a selection trigger is ipso facto turning the control into a button-like widget. Actions are a predefined set of behaviors that can be triggered.

Inputs

graph: ApexGraphHandle

The graph containing the current control.

control: ApexNodeID

The current control to be extended with an action.

trigger: String

Defines after which control interaction the given action is to be triggered.

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

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

Runs the action constantly during a control drag if the current control is the primary control. Attention: This can quickly have a negative impact on performance.

Runs the action directly after a control gets selected as a single selection. The interaction is then very similar to a button click.

Runs the action also if a given control gets box selected.

Runs the interaction after a mouse wheel event.

action: String

The type of action to be executed.

Executes a custom Python snippet that needs to be provided with the pythonsnippet input. The Python callback has automated bindings to the animate state with the following variables:

  • state: The apex animate state module.

  • apex: The apex module.

  • device: The UIEvent device class that can be used to fetch information about modifier keys.

  • hou: The standard Houdini Python module.

Selects a given number of controls after the given control interaction. The controls can be provided based on an APEX pattern with the pattern input argument.

Toggles the visibility status of a given number of controls. Similar to a selection set visibility change. The controls can be provided based on an APEX pattern with the pattern input argument.

Performs a space switch snap operation using the provided mappings. The mapping_a and mapping_b dictionaries define the transform mappings, and enableparm determines which mapping is active. The enable parm is either of a Bool and Int or a Float value.

Pins the animation channels in the animation editor of a given number of controls. Triggering the action again will unpin the given animation channels. The controls can be provided based on an APEX pattern with the pattern input argument.

pattern: String

An APEX pattern string used for 'select', 'setvisible', and 'pinchannels' actions to specify target controls.

mapping_a: Dict

Dictionary defining the first space switch mapping for the 'snap' action. Meaning the enable parm changes state from off to on.

mapping_b: Dict

Dictionary defining the second space switch mapping for the 'snap' action.Meaning the enable parm changes state from on to off.

parm: String

The parameter name used by 'snap' and 'pinchannels' actions.

enableparm: String

The enable parameter name for the 'snap' action. It defines for setups like space switches if mapping_a is to be used for mapping or if mapping_b is to be used for snapping.

pythonsnippet: String

Custom Python code to execute when using the 'python' action.

reset_a: StringArray

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

reset_b: StringArray

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

setparmvalue: Bool

Whether to set the parameter value for the 'snap' action paremeter defines by enableparm. Defaults to True.

Outputs

graph: ApexGraphHandle

The input graph handle (unchanged).

control: ApexNodeID

The control node with updated properties.

See also

APEX nodes