Houdini 22.0 Nodes APEX nodes

component::AddSpaceSwitchControl

Adds a space switch control to a control group for IK/FK or similar toggles.

On this page
Since 21.0

Creates a specialized configuration control that enables switching between two different transform spaces (such as IK and FK). The control displays as a toggle widget with visual feedback shapes, and automatically performs snapping operations when the space switch state changes.

This function combines the component::AddConfigControl node with the component::AddControlAction node to create a complete space switch setup that includes visual feedback and automatic transform matching between the two spaces.

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

Inputs

*graph: ApexGraphHandle Required

The APEX graph that contains the control group.

controlgroup: ApexNodeID

The control group subnet to add the space switch control to.

parentnode: ApexNodeID

The parent transform control that this space switch control is positioned relative to.

parentxform: Matrix4

The parent’s world transform matrix, used for computing world-oriented shape offsets.

name: String

The name for the space switch control. Used as the base for parameter naming and node identification.

mapping_a: Dict

A dictionary that defines the transform mappings when switching from the off to the on state. The dictionary keys are the driven control names, and the dictionary values are the driver control names to match transforms from.

mapping_b: Dict

A dictionary that defines the transform mappings when switching from the on to the off state. The dictionary keys are the driven control names, and the dictionary values are the driver control names to match transforms from.

spaceswitch_parm: String

The parameter name that controls the space switch blend value. If the name ends with “x”, shape feedback is connected to show the current state visually. In this case, the default parameter to blend between the two modes is assumed to be a Float, so that blending between the two spaces can be performed smoothly. The space switch control automatically sets the value for the parameter.

enableparm: String

The enable parameter name that determines the mapping that is active. This is used by the snap action to decide between mapping_a and mapping_b. This is usually a toggle.

trigger: String

The event that triggers the space switch action. Defaults to enddrag.

enddrag

Triggers the action after dragging on the current control is finished.

startdrag

Triggers the action before dragging on the control starts.

drag

Triggers the action during control drag. Warning: This can be slow.

selection

Triggers the action when the control is selected with a single click selection.

box_selected

Triggers the action after a box selection.

scroll

Triggers the action after a middle mouse scroll.

reset_a: StringArray

An array of control-channel name pairs to reset to default values when using mapping_a (switching from off to on).

reset_b: StringArray

An array of control-channel name pairs to reset to default values when using mapping_b (switching from on to off).

default_value: Bool

The initial state of the space switch toggle. False typically represents IK, and True represents FK. Defaults to False.

animatable: Bool

If set to True, the control accepts keyframe animation. Defaults to True.

instance: Int

The vertical stacking index. Higher values position the control lower relative to the parent. Defaults to 0.

place_left: Bool

If set to True, positions the control to the left of the parent. If set to False, positions the control to the right. Defaults to False.

color: Vector3

The display color for the control shape. Defaults to light gray, (0.8, 0.8, 0.8).

size: Float

The size of the control shape.

Outputs

*graph: ApexGraphHandle

The modified APEX graph.

control: ApexNodeID

The created space switch control node with snap action configured. The control is created using the spaceswitch control type and has a snap action attached for automatic transform matching when toggling between spaces.

See also

APEX nodes