A static view is a collection of camera-related settings that are defined in the product’s scene. Multiple static views can be defined in a product scene.

Static views make it easy to see the same product from different sides, with different camera settings or with a different background and foreground image. The methods below show how to get started with static views.

Static views are uniquely identifiable by their string name.

Method getViews

The method getViews() returns a list of available static view names.

getViews(): string[]
CODE

Returns

Type

Description

string[]

A list of available camera view names.

Example usage

views = context.staticViews.getViews();
CODE

Method getImage

Calling the getImage() method stores the current product configuration (i.e. parameter settings) on the Twikit server. An overview of all stored configurations can be viewed at https://configurations.twikit.com.

getImage(view: string, (dataUri: string) => void): void
CODE

Parameters

Name

Type

Description

view

string

The name of the static view.

-

function

New parameter value to set.

Example usage

views = context.staticViews.getViews()
context.staticViews.getImage(views[0], dataUri => {
    img.src = dataUri;
});
CODE

Static views demo application

The demo application that was built with Twikit collaboration with Tarform and FormLabs shows a great use case of static views. The feature is used to toggle an experience view. Explore the demo and blog article using the links below: