This Event class defines all events that can be consumed and fired by the EventBroadcaster. Use addEventListener or on to register event handler on your objects. You could also use the Emitter to globally register event handlers. Some events are fired in certain scopes. A scope is also considered to be the object the event could be registered on. Those scopes are documented in the events itself.

Example using a bootstrapping event.

Emitter.on(Event.BOOTSTRAP_START, viewer => { ... });

Example using a variant parameter event.

const variantInstance = await viewer.variantInstances.get('my_instance');
const variant = variantInstance.variant;
variant.on(Event.VARIANT_PARAMETER_COMMITTED, (variant, parameter) => { ... });

Example using a scene processing event.

const canvas = document.getElementById('viewer-canvas');
const viewer = new Viewer(canvas, createSpec());
viewer.on(Event.SCENE_PROCESSING_END, scene => {
scene.clearColor = new Color4(0, 0, 0, 0);
});
await viewer.bootstrap([]);

Hierarchy

  • Event

Properties

ASSET_LOADING_END: "assetLoadingEnd" = 'assetLoadingEnd'

Fired after loading an asset (e.g. glTF) onto the scene finished.

Scopes:

Payload:

ASSET_LOADING_START: "assetLoadingStart" = 'assetLoadingStart'

Fired before loading an asset (e.g. glTF) onto the scene.

Scopes:

Payload:

BOOTSTRAP_END: "bootstrapEnd" = 'bootstrapEnd'

Fired after bootstrapping of the Viewer finished.

Scopes:

Payload:

BOOTSTRAP_START: "bootstrapStart" = 'bootstrapStart'

Fired before bootstrapping of the Viewer starts.

Scopes:

Payload:

CAMERA_SWITCHED: "cameraSwitched" = 'cameraSwitched'

Fired after the active camera on the scene has been switched.

Scopes:

Payload:

  • camera: Camera
ELEMENT_CREATED: "elementCreated" = 'elementCreated'

Fired after an Element has been created.

Scopes:

Payload:

ELEMENT_NODES_CLONED: "elementNodesCloned" = 'elementNodesCloned'

Fired after the nodes of a Variant has been cloned to the Element.

Scopes:

Payload:

ELEMENT_PARAMETER_COMMITTED: "elementParameterCommitted" = 'elementParameterCommitted'

Fired after a parameter on an Element has been committed.

Scopes:

Payload:

  • element: Element
  • parameter: string
  • oldValue: string
  • newValue: string
ELEMENT_PICKED: "elementPicked" = 'elementPicked'

Fired after the Element under the cursor has been picked/selected.

Scopes:

Payload:

LOADING_END: "loadingEnd" = 'loadingEnd'

Fired after loading any type of JSON or resource finished.

Scopes:

  • Global

Payload:

  • path: string
LOADING_START: "loadingStart" = 'loadingStart'

Fired before loading any type of JSON or resource.

Scopes:

  • Global

Payload:

  • path: string
MESH_MATERIAL_APPLIED: "meshMaterialApplied" = 'meshMaterialApplied'

Fired after a Material has been applied to a Mesh.

Scopes:

  • Global

Payload:

MESH_PICKED: "meshPicked" = 'meshPicked'

Fired after the Mesh under the cursor has been picked/selected.

Scopes:

Payload:

SCENE_PARAMETER_COMMITTED: "sceneParameterCommitted" = 'sceneParameterCommitted'

Fired after a parameter on an SceneManager has been committed.

Scopes:

Payload:

  • variant: SceneManager
  • parameter: string
  • oldValue: string
  • newValue: string
SCENE_PROCESSING_END: "sceneProcessingEnd" = 'sceneProcessingEnd'

Fired after scene initialization end when bootstrapping the Viewer.

Scopes:

Payload:

SCENE_PROCESSING_START: "sceneProcessingStart" = 'sceneProcessingStart'

Fired before scene initialization starts when bootstrapping the Viewer.

Scopes:

Payload:

TAG_MANAGER_PARAMETER_COMMITTED: "tagManagerParameterCommitted" = 'tagManagerParameterCommitted'

Fired after a TagManagerParameterObserver has been called.

Scopes:

  • Global

Payload:

TEXTURE_LOADING_END: "textureLoadingEnd" = 'textureLoadingEnd'

Fired when the last Texture was successfully loaded.

Scopes:

TEXTURE_LOADING_START: "textureLoadingStart" = 'textureLoadingStart'

Fired when a bunch of Textures start loading.

Scopes:

VARIANT_CREATED: "variantCreated" = 'variantCreated'

Fired after a Variant has been created.

Scopes:

Payload:

VARIANT_DESTROYED: "variantDestroyed" = 'variantDestroyed'

Fired after a Variant has been destroyed.

Scopes:

Payload:

VARIANT_INSTANCES_READY: "variantInstancesReady" = 'variantInstancesReady'

Fired after all VariantInstances have been either created or registered.

Scopes:

Payload:

VARIANT_INSTANCE_CLONED: "variantInstanceCloned" = 'variantInstanceCloned'

Fired after a VariantInstance has been cloned.

Scopes:

Payload:

VARIANT_INSTANCE_CREATED: "variantInstanceCreated" = 'variantInstanceCreated'

Fired after a VariantInstance has been created.

Scopes:

Payload:

VARIANT_INSTANCE_DESTROYED: "variantInstanceDestroyed" = 'variantInstanceDestroyed'

Fired after a VariantInstance has been destroyed.

Scopes:

Payload:

VARIANT_INSTANCE_REGISTERED: "variantInstanceRegistered" = 'variantInstanceRegistered'

Fired after a VariantInstance has been registered. This is the case when the VariantInstance is considered "lazy".

Scopes:

Payload:

VARIANT_PARAMETER_BAG_COMMITTED: "variantParameterBagCommitted" = 'variantParameterBagCommitted'

Fired after a ParameterBag has been committed.

Scopes:

Payload:

VARIANT_PARAMETER_COMMITTED: "variantParameterCommitted" = 'variantParameterCommitted'

Fired after a parameter on a Variant has been committed.

Scopes:

Payload:

  • variant: Variant
  • parameter: string
  • oldValue: string
  • newValue: string
VARIANT_PICKED: "variantPicked" = 'variantPicked'

Fired after the Variant under the cursor has been picked/selected.

Scopes:

Payload:

VIEWER_LIGHT_PARAMETER_COMMITTED: "viewerLightParameterCommitted" = 'viewerLightParameterCommitted'

Fired after a parameter on an ViewerLight has been committed.

Scopes:

Payload:

  • light: ViewerLight
  • parameter: string
  • oldValue: string
  • newValue: string

Accessors

Generated using TypeDoc