Provides safe, validated methods to interact with the RpcClient. This class wraps the raw RPC methods with input validation and batching support for large operations.

Constructors

Accessors

Methods

  • Clears all material overrides for the specified component, restoring default materials.

    Parameters

    • componentHandle: number

      The unique identifier of the component

    Returns void

    If the component handle is invalid or INVALID_HANDLE

  • Creates multiple material instances with the same smoothness but different colors. Large color arrays are automatically processed in batches for better performance.

    Parameters

    • materialHandle: MaterialHandle

      The base material to create instances from

    • smoothness: number

      The smoothness value to apply (clamped between 0 and 1)

    • colors: RGBA32[]

      Array of colors for each material instance

    Returns Promise<number[]>

    Array of handles for the created material instances

    If the material handle is invalid or smoothness is out of range

  • Creates a 3D text element in the scene.

    Parameters

    • position: Vector3

      The world-space position for the text

    • color: RGBA32

      The color of the text

    • text: string

      The content to display

    Returns Promise<number>

    Promise resolving to the handle of the created text component

    If the text is empty

  • Destroys multiple material instances, freeing associated resources.

    Parameters

    • materialInstanceHandle: number[]

      Array of handles for material instances to destroy

    Returns void

    If any handle in the array is invalid

  • Destroys a text component, removing it from the scene.

    Parameters

    • componentHandle: number

      The handle of the text component to destroy

    Returns void

    If the component handle is invalid

  • Frames the camera to show all components in the scene.

    Parameters

    • blendTime: number

      Duration of the camera transition in seconds (non-negative)

    Returns Promise<Segment>

    Promise resolving to camera segment representing the final position

  • Frames the camera to show a specific bounding box.

    Parameters

    • box: Box3

      The bounding box to frame

    • blendTime: number

      Duration of the camera transition in seconds (non-negative)

    Returns Promise<Segment>

    If the box is invalid (min values must be less than max values)

  • Frames specific instances within a component. For large numbers of instances, automatically switches to bounding box framing for better performance.

    Parameters

    • componentHandle: number

      The component containing the instances

    • nodes: number[]

      Array of node indices to frame

    • blendTime: number

      Duration of the camera transition in seconds (non-negative)

    Returns Promise<Segment>

    Promise resolving to camera segment representing the final position

    If the component handle is invalid or nodes array is empty

  • Frames a specific VIM component in the scene.

    Parameters

    • componentHandle: number

      The handle of the VIM component to frame

    • blendTime: number

      Duration of the camera transition in seconds (non-negative)

    Returns Promise<Segment>

    Promise resolving to camera segment representing the final position

    If the component handle is invalid

  • Calculates the bounding box for specified nodes in a component. Large node arrays are automatically processed in batches for better performance.

    Parameters

    • componentHandle: number

      The component containing the nodes

    • nodes: number[]

      Array of node indices to calculate bounds for

    Returns Promise<Box3>

    Promise resolving to the combined bounding box

    If the component handle is invalid or nodes array is invalid

  • Makes specified nodes semi-transparent (ghosted) in a component. Large node arrays are automatically processed in batches.

    Parameters

    • componentHandle: number

      The component containing the nodes

    • nodes: number[]

      Array of node indices to ghost

    Returns void

    If the component handle is invalid or nodes array is invalid

  • Makes all nodes in a component semi-transparent (ghosted).

    Parameters

    • componentHandle: number

      The component to ghost entirely

    Returns void

    If the component handle is invalid

  • Hides specified nodes in a component, making them invisible. Large node arrays are automatically processed in batches.

    Parameters

    • componentHandle: number

      The component containing the nodes

    • nodes: number[]

      Array of node indices to hide

    Returns void

    If the component handle is invalid or nodes array is invalid

  • Hides the axis-aligned bounding boxes (AABBs) for specified nodes. Large node arrays are automatically processed in batches.

    Parameters

    • componentHandle: number

      The component containing the nodes

    • nodes: number[]

      Array of node indices whose AABBs should be hidden

    Returns void

    If the component handle is invalid or nodes array is invalid

  • Hides all nodes in a component, making the entire component invisible.

    Parameters

    • componentHandle: number

      The component to hide entirely

    Returns void

    If the component handle is invalid

  • Hides all axis-aligned bounding boxes (AABBs) in a component.

    Parameters

    • componentHandle: number

      The component whose AABBs should be hidden

    Returns void

    If the component handle is invalid

  • Highlights specified nodes in a component. Large node arrays are automatically processed in batches.

    Parameters

    • componentHandle: number

      The component containing the nodes

    • nodes: number[]

      Array of node indices to highlight

    Returns void

    If the component handle is invalid or nodes array is invalid

  • Highlights all nodes in a component.

    Parameters

    • componentHandle: number

      The component to highlight entirely

    Returns void

    If the component handle is invalid

  • Sends a keyboard event to the viewer.

    Parameters

    • keyCode: number

      The key code of the event

    • down: boolean

      True if key is pressed down, false if released

    Returns void

  • Sends a mouse button event to the viewer.

    Parameters

    • position: Vector2

      The normalized screen coordinates (0-1, 0-1)

    • mouseButton: number

      The mouse button code (0=left, 1=middle, 2=right)

    • down: boolean

      True if button is pressed down, false if released

    Returns void

    If mouseButton is not a valid positive integer

  • Sends a mouse double-click event to the viewer.

    Parameters

    • position: Vector2

      The normalized screen coordinates (0-1, 0-1)

    • mouseButton: number

      The mouse button code (0=left, 1=middle, 2=right)

    Returns void

    If mouseButton is not a valid positive integer

  • Sends a mouse selection event to the viewer.

    Parameters

    • position: Vector2

      The normalized screen coordinates (0-1, 0-1)

    • mouseButton: number

      The mouse button code (0=left, 1=middle, 2=right)

    Returns void

    If mouseButton is not a valid positive integer

  • Sets the viewer's aspect ratio.

    Parameters

    • width: number

      The width component of the aspect ratio

    • height: number

      The height component of the aspect ratio

    Returns void

    If width or height are not positive integers

  • Sets the camera position and orientation.

    Parameters

    • segment: Segment

      The desired camera position and target

    • blendTime: number

      Duration of the camera transition in seconds (non-negative)

    Returns void

    If segment is invalid or blendTime is negative

  • Sets material overrides for specific nodes in a component. Large arrays are automatically processed in batches for better performance.

    Parameters

    • componentHandle: number

      The component containing the nodes

    • nodes: number[]

      Array of node indices to override

    • materialInstanceHandles: number[]

      Array of material instance handles to apply (must match nodes length)

    Returns void

    If arrays have different lengths or any handle is invalid

  • Shows specified nodes in a component, making them visible. Large node arrays are automatically processed in batches.

    Parameters

    • componentHandle: number

      The component containing the nodes

    • nodes: number[]

      Array of node indices to show

    Returns void

    If the component handle is invalid or nodes array is invalid

  • Shows axis-aligned bounding boxes (AABBs) for specified nodes with custom colors. Large arrays are automatically processed in batches for better performance.

    Parameters

    • componentHandle: number

      The component containing the nodes

    • nodes: number[]

      Array of node indices to show AABBs for

    • colors: RGBA32[]

      Array of colors for each AABB (must match nodes length)

    Returns void

    If arrays have different lengths or component handle is invalid

  • Shows all nodes in a component, making the entire component visible.

    Parameters

    • componentHandle: number

      The component to show entirely

    Returns void

    If the component handle is invalid

  • Unloads a VIM component and frees associated resources.

    Parameters

    • componentHandle: number

      The handle of the component to unload

    Returns void

    If the component handle is invalid