configureGizmo

configureGizmo

Configure the interactive transform gizmo - translate, rotate, and scale handles shown in the viewport.

Signature

configureGizmo(options: GizmoOptions): Promise<GizmoState>

Parameters

Parameter
Type
Required
Description

options

GizmoOptions

Yes

Partial options to apply

GizmoOptions

type GizmoOptions = {
  enabled?: boolean;       // Show/hide the gizmo
  advancedMode?: boolean;  // Show plane handles (TXY, TYZ, TZX, SXY, SYZ, SZX)
  localSpace?: boolean;    // Use local orientation instead of world
  snap?: {
    enabled?: boolean;       // Master snap toggle
    grid?: boolean;          // Grid snapping for translation
    angle?: boolean;         // Angle snapping for rotation
    gridResolution?: number; // Grid size in scene units (e.g., 0.5)
    angleParam?: number;     // Angle increment in degrees (e.g., 15)
    toFace?: boolean;        // Snap to faces of other objects
  };
  handles?: GizmoHandleOptions; // Per-handle visibility controls
};

GizmoHandleOptions

AxisOptions accepts:

  • true / false — toggle all axes at once

  • { x?: boolean, y?: boolean, z?: boolean } — per-axis control

Notes:

  • Plane handles (TXY, TYZ, TZX, SXY, SYZ, SZX) are automatically hidden if either of their constituent axes is disabled. For example, disabling translate X also hides TXY and TZX.

  • Plane handles additionally require advancedMode: true to be visible.

  • Omitted groups are left unchanged from their current state.

GizmoState

Returns

Promise<GizmoState> - the full gizmo state after applying the options.

Examples

Last updated