Houdini 21.0 Nodes APEX nodes

controlgadget::SnapXFormToAxes

Snaps a transform to the specified axes during a mouse drag.

On this page
Since 21.0

Inputs

xform: Matrix4

The current transform for the dragged component.

root_xform: Matrix4

The transform for the dragged component at the start of the drag.

axes_alignment: Matrix4

The alignment and position of the axes to snap to.

cursor_offset: Vector3

The position offset from the translation part of xform to the cursor.

ray_dir: Vector3

The current mouse ray direction.

ray_orig: Vector3

The current mouse ray origin.

start_ray_dir: Vector3

The mouse ray direction at the start of the drag.

start_ray_orig: Vector3

The mouse ray origin at the start of the drag.

snap_angle_deg: Float

The maximal angle to snap within, in degrees. This angle is computed between the line connecting the translation parts of xform and root_xform, and the closest axis defined by axes_alignment.

Outputs

xform: Matrix4

The resulting matrix - either the original xform passed through if the computed angle exceeds snap_angle_deg, or the xform snapped to the specified axes.

axis_geo: Geometry

The geometry that can be used in a drawable to visualize the snap action.

snapped: Bool

Returns True if a snap is performed.

See also

APEX nodes