sceneIO

Loading, reading, exporting of the scene.

Methods

(static) clearScene() → {Promise}

Clears current scene

Returns:
Type
Promise

(static) fetch(sceneId, hash, options)

Fetch the scene

If hash is provided it will fetch directly from resources, otherwise it will fetch from the api. By default, it will fetch the latest published version. If you wish to ensure you are fetching the latest scene version, set waitForPublish: true.

Parameters:
Name Type Description
sceneId uuid
hash String

md5 hash of published content (Optional)

options Object
Properties
Name Type Description
waitForPublish Boolean

Wait for the latest scene version to be published (default false);

pinned Boolean

Fetch the latest pinned scene.

(static) fetchAndUse(sceneId, hash, options)

Fetch, Load and Use published scene

If hash is provided it will fetch directly from resources, otherwise it will fetch from /api/scenes/:uuid/published.

Parameters:
Name Type Description
sceneId uuid
hash String

md5 hash of published content (Optional)

options Object
Properties
Name Type Description
waitForPublish Boolean

Wait for the latest scene version to be published (default false);

(static) getSceneId() → {uuid}

Returns the active scene Id

Returns:
Type
uuid

(static) loadScene(id, transitString) → {Promise}

Loads the published scene

Parameters:
Name Type Description
id string

the scene uuid.

transitString string

the published, exported scene

Returns:
Type
Promise

(static) prefetch(sceneId, hash, options)

This will fetch the published scene, but will not do anything with it. This is useful if you wish to warm the cache in order to speed up the loading of the next scene, without loading the scene into memory.

If hash is provided it will fetch directly from resources, otherwise it will fetch from the api. By default, it will fetch the latest published version. If you wish to ensure you are fetching the latest scene version, set waitForPublish: true.

Parameters:
Name Type Description
sceneId uuid
hash String

md5 hash of published content (Optional)

options Object
Properties
Name Type Description
waitForPublish Boolean

Wait for the latest scene version to be published (default false);

(static) whenLoaded(callbackopt) → {Promise}

This selector will return a promise that resolves when all assets in the scene have been fetched and rendered.

Parameters:
Name Type Attributes Description
callback function <optional>

If provided, will be called with the number of assets remaining to be loaded as the first argument.

Returns:
Type
Promise