toggleVisibility

toggleVisibility

Shows, hides, or toggles visibility of objects in the scene.

Signature

toggleVisibility(objectNames: string[], visible?: boolean): Promise<void>

Parameters

Name
Type
Required
Description

objectNames

string[]

Yes

Array of object names

visible

boolean

No

true to show, false to hide. If omitted, toggles current state

Returns

Promise<void>

Usage

// Toggle visibility (switch current state)
await api.toggleVisibility(["Chair"]);

// Hide objects
await api.toggleVisibility(["Chair", "Table"], false);

// Show objects
await api.toggleVisibility(["Chair", "Table"], true);

Notes

  • When visible parameter is omitted, the method toggles the current visibility state

  • Only accepts array of names, not a single string

Last updated