Skip to main content

Class: GLTFAnimationPlugin

Plugins.GLTFAnimationPlugin

Hierarchy

  • AViewerPlugin<"checkpointEnd" | "checkpointBegin" | "animationStep">

    GLTFAnimationPlugin

Properties

PluginType

Static Readonly PluginType: "GLTFAnimation"

Defined in

webgi/src/plugins/GLTFAnimationPlugin.ts:31


AnimationMarkersExtension

Static Readonly AnimationMarkersExtension: "WEBGI_animation_markers"

Defined in

webgi/src/plugins/GLTFAnimationPlugin.ts:428


enabled

enabled: boolean = true

Overrides

AViewerPlugin.enabled

Defined in

webgi/src/plugins/GLTFAnimationPlugin.ts:29


animations

Readonly animations: { mixer: AnimationMixer ; clips: AnimationClip[] ; actions: AnimationAction[] ; duration: number }[] = []

Defined in

webgi/src/plugins/GLTFAnimationPlugin.ts:43


loopAnimations

loopAnimations: boolean = true

Defined in

webgi/src/plugins/GLTFAnimationPlugin.ts:47


loopRepetitions

loopRepetitions: number = Infinity

Defined in

webgi/src/plugins/GLTFAnimationPlugin.ts:49


timeScale

timeScale: number = 0

Timescale for animation actions, For Animation action. Set 0 to use the value in the Animation Action.

Defined in

webgi/src/plugins/GLTFAnimationPlugin.ts:54


animateOnScroll

animateOnScroll: boolean = false

Defined in

webgi/src/plugins/GLTFAnimationPlugin.ts:56


animationSpeed

animationSpeed: number = 1

Defined in

webgi/src/plugins/GLTFAnimationPlugin.ts:57


scrollAnimationDamping

scrollAnimationDamping: number = 0.1

Defined in

webgi/src/plugins/GLTFAnimationPlugin.ts:59


dependencies

dependencies: typeof AssetManagerPlugin[]

Defined in

webgi/src/plugins/GLTFAnimationPlugin.ts:61


uiConfig

Optional uiConfig: UiObjectConfig<any, string> = undefined

Defined in

webgi/src/plugins/GLTFAnimationPlugin.ts:285


timelineMarkers

timelineMarkers: any[] = []

Defined in

webgi/src/plugins/GLTFAnimationPlugin.ts:429


_dirty

Protected _dirty: boolean = false

Inherited from

AViewerPlugin._dirty

Defined in

webgi/src/core/AViewerPlugin.ts:25


_viewer

Protected Optional _viewer: ViewerApp

Inherited from

AViewerPlugin._viewer

Defined in

webgi/src/core/AViewerPlugin.ts:29


_animationState

Protected _animationState: "none" | "playing" | "paused" | "stopped" = 'none'

Defined in

webgi/src/plugins/GLTFAnimationPlugin.ts:273

Accessors

dirty

get dirty(): boolean

Returns

boolean

Inherited from

AViewerPlugin.dirty

Defined in

webgi/src/core/AViewerPlugin.ts:18

set dirty(value): void

Parameters

NameType
valueboolean

Returns

void

Inherited from

AViewerPlugin.dirty

Defined in

webgi/src/core/AViewerPlugin.ts:22


animationState

get animationState(): "none" | "playing" | "paused" | "stopped"

Returns

"none" | "playing" | "paused" | "stopped"

Defined in

webgi/src/plugins/GLTFAnimationPlugin.ts:33


animationTime

get animationTime(): number

Returns

number

Defined in

webgi/src/plugins/GLTFAnimationPlugin.ts:36


animationDuration

get animationDuration(): number

Returns

number

Defined in

webgi/src/plugins/GLTFAnimationPlugin.ts:39

Methods

onDispose

onDispose(viewer): Promise<void>

Parameters

NameType
viewerViewerApp

Returns

Promise<void>

Inherited from

AViewerPlugin.onDispose

Defined in

webgi/src/core/AViewerPlugin.ts:38


toJSON

toJSON(meta?): any

Parameters

NameType
meta?any

Returns

any

Inherited from

AViewerPlugin.toJSON

Defined in

webgi/src/core/AViewerPlugin.ts:47


fromJSON

fromJSON(data, meta?): null | GLTFAnimationPlugin | Promise<null | GLTFAnimationPlugin>

Parameters

NameType
dataany
meta?any

Returns

null | GLTFAnimationPlugin | Promise<null | GLTFAnimationPlugin>

Inherited from

AViewerPlugin.fromJSON

Defined in

webgi/src/core/AViewerPlugin.ts:54


addEventListener

addEventListener(type, listener): void

Adds a listener to an event type.

Parameters

NameType
type"serialize" | "deserialize" | "checkpointEnd" | "checkpointBegin" | "animationStep"
listener(event: IEvent<"serialize" | "deserialize" | "checkpointEnd" | "checkpointBegin" | "animationStep">) => void

Returns

void

Inherited from

AViewerPlugin.addEventListener

Defined in

webgi/src/helpers/EventDispatcher.ts:48


hasEventListener

hasEventListener(type, listener): boolean

Checks if listener is added to an event type.

Parameters

NameType
type"serialize" | "deserialize" | "checkpointEnd" | "checkpointBegin" | "animationStep"
listener(event: IEvent<"serialize" | "deserialize" | "checkpointEnd" | "checkpointBegin" | "animationStep">) => void

Returns

boolean

Inherited from

AViewerPlugin.hasEventListener

Defined in

webgi/src/helpers/EventDispatcher.ts:56


removeEventListener

removeEventListener(type, listener): void

Removes a listener from an event type.

Parameters

NameType
type"serialize" | "deserialize" | "checkpointEnd" | "checkpointBegin" | "animationStep"
listener(event: IEvent<"serialize" | "deserialize" | "checkpointEnd" | "checkpointBegin" | "animationStep">) => void

Returns

void

Inherited from

AViewerPlugin.removeEventListener

Defined in

webgi/src/helpers/EventDispatcher.ts:63


dispatchEvent

dispatchEvent(event): void

Fire an event type.

Parameters

NameType
eventIEvent<"serialize" | "deserialize" | "checkpointEnd" | "checkpointBegin" | "animationStep">

Returns

void

Inherited from

AViewerPlugin.dispatchEvent

Defined in

webgi/src/helpers/EventDispatcher.ts:74


onAdded

onAdded(viewer): Promise<void>

Parameters

NameType
viewerViewerApp

Returns

Promise<void>

Overrides

AViewerPlugin.onAdded

Defined in

webgi/src/plugins/GLTFAnimationPlugin.ts:221


onRemove

onRemove(viewer): Promise<void>

Parameters

NameType
viewerViewerApp

Returns

Promise<void>

Overrides

AViewerPlugin.onRemove

Defined in

webgi/src/plugins/GLTFAnimationPlugin.ts:259


onPropertyChange

onPropertyChange(): void

Returns

void

Defined in

webgi/src/plugins/GLTFAnimationPlugin.ts:275


onStateChange

onStateChange(): void

Returns

void

Defined in

webgi/src/plugins/GLTFAnimationPlugin.ts:282


playPauseAnimation

playPauseAnimation(): void

Returns

void

Defined in

webgi/src/plugins/GLTFAnimationPlugin.ts:291


playClip

playClip(name, resetOnEnd?): Promise<void>

Parameters

NameTypeDefault value
namestringundefined
resetOnEndbooleanfalse

Returns

Promise<void>

Defined in

webgi/src/plugins/GLTFAnimationPlugin.ts:295


playClips

playClips(names, resetOnEnd?): Promise<void>

Parameters

NameTypeDefault value
namesstring[]undefined
resetOnEndbooleanfalse

Returns

Promise<void>

Defined in

webgi/src/plugins/GLTFAnimationPlugin.ts:298


playAnimation

playAnimation(resetOnEnd?, animations?): Promise<void>

Starts all the animations and returns a promise that resolves when all animations are done.

Parameters

NameTypeDefault valueDescription
resetOnEndbooleanfalseif true, will reset the animation to the start position when it ends.
animations?AnimationAction[]undefinedplay specific animations, otherwise play all animations. Note: the promise returned (if this is set) from this will resolve before time if the animations was ever paused, or converged mode is on in recorder.

Returns

Promise<void>

Defined in

webgi/src/plugins/GLTFAnimationPlugin.ts:318


pauseAnimation

pauseAnimation(): void

Returns

void

Defined in

webgi/src/plugins/GLTFAnimationPlugin.ts:390


stopAnimation

stopAnimation(reset?): void

Parameters

NameTypeDefault value
resetbooleanfalse

Returns

void

Defined in

webgi/src/plugins/GLTFAnimationPlugin.ts:399


resetAnimation

resetAnimation(): void

Returns

void

Defined in

webgi/src/plugins/GLTFAnimationPlugin.ts:414

Constructors

constructor

new GLTFAnimationPlugin()

Overrides

AViewerPlugin.constructor

Defined in

webgi/src/plugins/GLTFAnimationPlugin.ts:201