Skip to content

Scene

A saved camera position and view state — like a bookmark for a particular viewpoint in the model.

Scenes appear as tabs or thumbnails inside SketchUp. When a user clicks a scene, SketchUp restores the camera angle, tag visibility, shadow settings, and style that were saved with it. The properties field records exactly which of those settings this scene captures.

Retrieve all scenes with model.getScenes(). Create new scenes inside a performOperation with op.createScene().

let model = await SketchUpApi.getActiveModel();
// Save the current view as a named scene
await model.performOperation(op => {
const ref = op.createScene('Exterior View');
op.sceneSetDescription(
ref, 'Front of the building'
);
}, 'Add scene');
// Read it back
let scenes = await model.getScenes();
let scene = scenes[0];
console.log(scene.name);
// => 'Exterior View'
console.log(scene.description);
// => 'Front of the building'

SDK 2.10.0 Protocol 1.7.0

readonly animation: Readonly<SketchupSceneAnimationInfo>

Timing settings for how this scene plays during a slideshow, including the transition delay and duration in seconds.


readonly attributes: Attributes

User-defined key-value data attached to this scene.


readonly axes: Axes | undefined

The custom axis orientation saved with this scene, if any.


readonly camera: Camera

The camera data stored with this scene — eye position, target, up vector, and field of view. Use getCamera() if you need coordinate conversion helpers.


readonly description: string | undefined

The text shown in the Scenes panel for this scene, like 'Front elevation view'.


readonly environmentId: number | undefined

The persistent identifier of the environment (sky/background) associated with this scene.


readonly id: number

The persistent numeric identifier for this scene, stable across sessions.


readonly label: string | undefined

An alternate display label for certain UI contexts.


readonly name: string | undefined

The user-visible tab label shown at the top of the viewport, like 'Exterior View'.


readonly properties: Readonly<SketchupSceneProperties>

Flags indicating which scene properties SketchUp saves and restores when the user activates this scene.


readonly style: StyleRef | undefined

A reference to the style applied when this scene is active. Use model.getStyles() to resolve this to a full Style.


readonly type: Scene = EntityType.Scene

get sketchupId(): SketchupId

JS API identifier for this scene. Pass it to API methods that accept a sketchupId.

SketchupId


get typeName(): string

Returns a named variant of the type field.

SDK 2.35.0

string

getActiveSectionPlanes(options?): Promise<SectionPlane[]>

Fetches the section planes that are active when this scene is shown.

Parameter Type Description

options?

EntityQuery<EntityFilter>

optional filter to narrow results by entity type

Promise<SectionPlane[]>

the active section planes for this scene

SDK 2.29.0 Protocol 1.13.0


getAxes(): Promise<Axes | undefined>

Fetches the custom axes orientation saved with this scene, if any.

Promise<Axes | undefined>

the axes for this scene, or undefined if not saved

SDK 2.10.0 Protocol 1.7.0


getCamera(): Promise<Camera>

Fetches the full Camera object saved with this scene. Useful if you need the full capabilities not provided by the .camera property.

Promise<Camera>

the camera for this scene

SDK 2.10.0 Protocol 1.7.0


getHiddenElements<Filter>(options?): Promise<EntityTypeForFilter<Filter, DrawingElement>[]>

Fetches the drawing elements hidden when this scene is active.

Type Parameter

Filter extends EntityFilter

Parameter Type Description

options?

EntityQuery<Filter>

optional filter to narrow results by entity type

Promise<EntityTypeForFilter<Filter, DrawingElement>[]>

the hidden drawing elements in this scene

SDK 2.10.0 Protocol 1.7.0

getHiddenElements(options?): Promise<DrawingElement[]>

Parameter Type

options?

SketchupEntityFilter

Promise<DrawingElement[]>


getHiddenTagFolders(options?): Promise<TagFolder[]>

Fetches the tag folders that are hidden when this scene is active. Mirrors getHiddenTags() but for tag folders.

Parameter Type Description

options?

EntityQuery<EntityFilter>

optional filter to narrow the results

Promise<TagFolder[]>

the tag folders hidden in this scene

SDK 2.10.0 Protocol 1.7.0

getHiddenTagFolders(options): Promise<TagFolder[]>

Parameter Type

options

SketchupEntityFilter

Promise<TagFolder[]>


getHiddenTags(options?): Promise<Tag[]>

Fetches the tags that are hidden when this scene is active. Only tags explicitly hidden by this scene are returned.

Parameter Type Description

options?

EntityQuery<EntityFilter>

optional filter to narrow results by tag name or other criteria

Promise<Tag[]>

the tags hidden in this scene

SDK 2.10.0 Protocol 1.7.0

getHiddenTags(options): Promise<Tag[]>

Parameter Type

options

SketchupEntityFilter

Promise<Tag[]>


getRenderingOptions(): Promise<RenderingOptions | undefined>

Fetches the rendering options saved with this scene, if any.

Promise<RenderingOptions | undefined>

a snapshot of the rendering options for this scene, or undefined if not saved

SDK 2.24.0 Protocol 1.21.0


getShadowInfo(): Promise<ShadowInfo | undefined>

Fetches the shadow settings saved with this scene, if any.

Promise<ShadowInfo | undefined>

the shadow settings for this scene, or undefined

SDK 2.10.0 Protocol 1.7.0


refresh(): Promise<Scene>

Re-fetches this scene from SketchUp to pick up any changes made by the user since this snapshot was taken.

Promise<Scene>

the latest version of this scene from SketchUp


toString(): string

string

readonly styleId: number | undefined

The persistent id of the style associated with this scene


activeSectionPlanes(filter?): Promise<readonly SectionPlane[]>

Query to find only the active section planes for this scene (protocol)

Parameter Type Default value Description

filter

SketchupEntityFilter | undefined

undefined

when provided, filters the list of active section planes

Promise<readonly SectionPlane[]>

a promise containing a snapshot of the active section planes for this scene

SDK 2.16.0 Protocol 1.13.0