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:30


AnimationMarkersExtension

Static Readonly AnimationMarkersExtension: "WEBGI_animation_markers"

Defined in

webgi/src/plugins/GLTFAnimationPlugin.ts:544


enabled

enabled: boolean = true

Overrides

AViewerPlugin.enabled

Defined in

webgi/src/plugins/GLTFAnimationPlugin.ts:28


autoIncrementTime

autoIncrementTime: boolean = true

If true, the animation time will be automatically incremented by the time delta, otherwise it has to be set manually between 0 and the animationDuration using setTime. (default: true)

Defined in

webgi/src/plugins/GLTFAnimationPlugin.ts:38


animations

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

Defined in

webgi/src/plugins/GLTFAnimationPlugin.ts:54


loopAnimations

loopAnimations: boolean = true

Defined in

webgi/src/plugins/GLTFAnimationPlugin.ts:59


loopRepetitions

loopRepetitions: number = Infinity

Defined in

webgi/src/plugins/GLTFAnimationPlugin.ts:62


timeScale

timeScale: number = 1

Timescale for the animation. (not individual actions) If set to 0, it will be ignored.

Defined in

webgi/src/plugins/GLTFAnimationPlugin.ts:69


animationSpeed

animationSpeed: number = 1

Defined in

webgi/src/plugins/GLTFAnimationPlugin.ts:77


animateOnScroll

animateOnScroll: boolean = false

Defined in

webgi/src/plugins/GLTFAnimationPlugin.ts:79


scrollAnimationDamping

scrollAnimationDamping: number = 0.1

Defined in

webgi/src/plugins/GLTFAnimationPlugin.ts:81


animateOnDrag

animateOnDrag: boolean = false

Defined in

webgi/src/plugins/GLTFAnimationPlugin.ts:83


dragAxis

dragAxis: "x" | "y" = 'y'

Defined in

webgi/src/plugins/GLTFAnimationPlugin.ts:86


autoplayOnLoad

autoplayOnLoad: boolean = false

If true, the animation will be played automatically when the model(any model with animations) is loaded.

Defined in

webgi/src/plugins/GLTFAnimationPlugin.ts:91


syncMaxDuration

syncMaxDuration: boolean = false

Sync the duration of all clips based on the max duration, helpful for things like timeline markers

Defined in

webgi/src/plugins/GLTFAnimationPlugin.ts:96


dragAnimationDamping

dragAnimationDamping: number = 0.3

Defined in

webgi/src/plugins/GLTFAnimationPlugin.ts:99


dependencies

dependencies: typeof AssetManagerPlugin[]

Defined in

webgi/src/plugins/GLTFAnimationPlugin.ts:101


uiConfig

Optional uiConfig: UiObjectConfig<any, string> = undefined

Defined in

webgi/src/plugins/GLTFAnimationPlugin.ts:371


timelineMarkers

timelineMarkers: any[] = []

Defined in

webgi/src/plugins/GLTFAnimationPlugin.ts:545


_dirty

Protected _dirty: boolean = false

Inherited from

AViewerPlugin._dirty

Defined in

webgi/src/core/AViewerPlugin.ts:23


_viewer

Protected Optional _viewer: ViewerApp

Inherited from

AViewerPlugin._viewer

Defined in

webgi/src/core/AViewerPlugin.ts:27


_animationState

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

Defined in

webgi/src/plugins/GLTFAnimationPlugin.ts:359

Accessors

dirty

get dirty(): boolean

Returns

boolean

Inherited from

AViewerPlugin.dirty

Defined in

webgi/src/core/AViewerPlugin.ts:16

set dirty(value): void

Parameters

NameType
valueboolean

Returns

void

Inherited from

AViewerPlugin.dirty

Defined in

webgi/src/core/AViewerPlugin.ts:20


animationState

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

Returns

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

Defined in

webgi/src/plugins/GLTFAnimationPlugin.ts:40


animationTime

get animationTime(): number

Returns

number

Defined in

webgi/src/plugins/GLTFAnimationPlugin.ts:43


animationDuration

get animationDuration(): number

Returns

number

Defined in

webgi/src/plugins/GLTFAnimationPlugin.ts:46

Methods

onDispose

onDispose(viewer): Promise<void>

Parameters

NameType
viewerViewerApp

Returns

Promise<void>

Inherited from

AViewerPlugin.onDispose

Defined in

webgi/src/core/AViewerPlugin.ts:36


toJSON

toJSON(meta?): any

Parameters

NameType
meta?any

Returns

any

Inherited from

AViewerPlugin.toJSON

Defined in

webgi/src/core/AViewerPlugin.ts:45


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:52


exportState

exportState(): any

Returns

any

Inherited from

AViewerPlugin.exportState

Defined in

webgi/src/core/AViewerPlugin.ts:64


importState

importState(state): Promise<void>

Parameters

NameType
stateany

Returns

Promise<void>

Inherited from

AViewerPlugin.importState

Defined in

webgi/src/core/AViewerPlugin.ts:67


storeState

storeState(prefix?, storage?, data?): void

Parameters

NameType
prefix?string
storage?Storage
data?any

Returns

void

Inherited from

AViewerPlugin.storeState

Defined in

webgi/src/core/AViewerPlugin.ts:74


loadState

loadState(prefix?, storage?): Promise<void>

Parameters

NameType
prefix?string
storage?Storage

Returns

Promise<void>

Inherited from

AViewerPlugin.loadState

Defined in

webgi/src/core/AViewerPlugin.ts:84


setTime

setTime(time): void

Parameters

NameType
timenumber

Returns

void

Defined in

webgi/src/plugins/GLTFAnimationPlugin.ts:50


onAdded

onAdded(viewer): Promise<void>

Parameters

NameType
viewerViewerApp

Returns

Promise<void>

Overrides

AViewerPlugin.onAdded

Defined in

webgi/src/plugins/GLTFAnimationPlugin.ts:304


onRemove

onRemove(viewer): Promise<void>

Parameters

NameType
viewerViewerApp

Returns

Promise<void>

Overrides

AViewerPlugin.onRemove

Defined in

webgi/src/plugins/GLTFAnimationPlugin.ts:344


onStateChange

onStateChange(): void

Returns

void

Defined in

webgi/src/plugins/GLTFAnimationPlugin.ts:368


playPauseAnimation

playPauseAnimation(): void

Returns

void

Defined in

webgi/src/plugins/GLTFAnimationPlugin.ts:377


playClip

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

This will play a single clip by name It might reset all other animations, this is a bug; https://codepen.io/repalash/pen/mdjgpvx

Parameters

NameTypeDefault value
namestringundefined
resetOnEndbooleanfalse

Returns

Promise<void>

Defined in

webgi/src/plugins/GLTFAnimationPlugin.ts:387


playClips

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

Parameters

NameTypeDefault value
namesstring[]undefined
resetOnEndbooleanfalse

Returns

Promise<void>

Defined in

webgi/src/plugins/GLTFAnimationPlugin.ts:390


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:410


pauseAnimation

pauseAnimation(): void

Returns

void

Defined in

webgi/src/plugins/GLTFAnimationPlugin.ts:494


resumeAnimation

resumeAnimation(): void

Returns

void

Defined in

webgi/src/plugins/GLTFAnimationPlugin.ts:504


stopAnimation

stopAnimation(reset?): void

Parameters

NameTypeDefault value
resetbooleanfalse

Returns

void

Defined in

webgi/src/plugins/GLTFAnimationPlugin.ts:515


resetAnimation

resetAnimation(): void

Returns

void

Defined in

webgi/src/plugins/GLTFAnimationPlugin.ts:530


_storeKey

Protected _storeKey(prefix?): string

Parameters

NameType
prefix?string

Returns

string

Inherited from

AViewerPlugin._storeKey

Defined in

webgi/src/core/AViewerPlugin.ts:60

Constructors

constructor

new GLTFAnimationPlugin()

Overrides

AViewerPlugin.constructor

Defined in

webgi/src/plugins/GLTFAnimationPlugin.ts:283