Class: GLTFAnimationPlugin
Plugins.GLTFAnimationPlugin
Hierarchy
AViewerPlugin<"checkpointEnd"|"checkpointBegin"|"animationStep">↳
GLTFAnimationPlugin
Properties
PluginType
▪ Static Readonly PluginType: "GLTFAnimation"
AnimationMarkersExtension
▪ Static Readonly AnimationMarkersExtension: "WEBGI_animation_markers"
enabled
• enabled: boolean = true
Overrides
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)
animations
• Readonly animations: { mixer: AnimationMixer ; clips: AnimationClip[] ; actions: AnimationAction[] ; duration: number }[] = []
loopAnimations
• loopAnimations: boolean = true
loopRepetitions
• loopRepetitions: number = Infinity
timeScale
• timeScale: number = 1
Timescale for the animation. (not individual actions) If set to 0, it will be ignored.
animationSpeed
• animationSpeed: number = 1
animateOnScroll
• animateOnScroll: boolean = false
scrollAnimationDamping
• scrollAnimationDamping: number = 0.1
animateOnDrag
• animateOnDrag: boolean = false
dragAxis
• dragAxis: "x" | "y" = 'y'
autoplayOnLoad
• autoplayOnLoad: boolean = false
If true, the animation will be played automatically when the model(any model with animations) is loaded.
syncMaxDuration
• syncMaxDuration: boolean = false
Sync the duration of all clips based on the max duration, helpful for things like timeline markers
dragAnimationDamping
• dragAnimationDamping: number = 0.3
dependencies
• dependencies: typeof AssetManagerPlugin[]
uiConfig
• Optional uiConfig: UiObjectConfig<any, string> = undefined
timelineMarkers
• timelineMarkers: any[] = []
_dirty
• Protected _dirty: boolean = false
Inherited from
_viewer
• Protected Optional _viewer: ViewerApp
Inherited from
_animationState
• Protected _animationState: "playing" | "stopped" | "paused" | "none" = 'none'
Accessors
dirty
• get dirty(): boolean
Returns
boolean
Inherited from
AViewerPlugin.dirty
• set dirty(value): void
Parameters
| Name | Type |
|---|---|
value | boolean |
Returns
void
Inherited from
AViewerPlugin.dirty
viewer
• get viewer(): undefined | ViewerApp
Returns
undefined | ViewerApp
Inherited from
AViewerPlugin.viewer
animationState
• get animationState(): "playing" | "stopped" | "paused" | "none"
Returns
"playing" | "stopped" | "paused" | "none"
animationTime
• get animationTime(): number
Returns
number
animationDuration
• get animationDuration(): number
Returns
number
Methods
onDispose
▸ onDispose(viewer): Promise<void>
Parameters
| Name | Type |
|---|---|
viewer | ViewerApp |
Returns
Promise<void>
Inherited from
toJSON
▸ toJSON(meta?): any
Parameters
| Name | Type |
|---|---|
meta? | any |
Returns
any
Inherited from
fromJSON
▸ fromJSON(data, meta?): null | GLTFAnimationPlugin | Promise<null | GLTFAnimationPlugin>
Parameters
| Name | Type |
|---|---|
data | any |
meta? | any |
Returns
null | GLTFAnimationPlugin | Promise<null | GLTFAnimationPlugin>
Inherited from
exportState
▸ exportState(): any
Returns
any
Inherited from
importState
▸ importState(state): Promise<void>
Parameters
| Name | Type |
|---|---|
state | any |
Returns
Promise<void>
Inherited from
storeState
▸ storeState(prefix?, storage?, data?): void
Parameters
| Name | Type |
|---|---|
prefix? | string |
storage? | Storage |
data? | any |
Returns
void
Inherited from
loadState
▸ loadState(prefix?, storage?): Promise<void>
Parameters
| Name | Type |
|---|---|
prefix? | string |
storage? | Storage |
Returns
Promise<void>
Inherited from
setTime
▸ setTime(time): void
Parameters
| Name | Type |
|---|---|
time | number |
Returns
void
onAdded
▸ onAdded(viewer): Promise<void>
Parameters
| Name | Type |
|---|---|
viewer | ViewerApp |
Returns
Promise<void>
Overrides
onRemove
▸ onRemove(viewer): Promise<void>
Parameters
| Name | Type |
|---|---|
viewer | ViewerApp |
Returns
Promise<void>
Overrides
onStateChange
▸ onStateChange(): void
Returns
void
playPauseAnimation
▸ playPauseAnimation(): void
Returns
void
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
| Name | Type | Default value |
|---|---|---|
name | string | undefined |
resetOnEnd | boolean | false |
Returns
Promise<void>
playClips
▸ playClips(names, resetOnEnd?): Promise<void>
Parameters
| Name | Type | Default value |
|---|---|---|
names | string[] | undefined |
resetOnEnd | boolean | false |
Returns
Promise<void>
playAnimation
▸ playAnimation(resetOnEnd?, animations?): Promise<void>
Starts all the animations and returns a promise that resolves when all animations are done.
Parameters
| Name | Type | Default value | Description |
|---|---|---|---|
resetOnEnd | boolean | false | if true, will reset the animation to the start position when it ends. |
animations? | AnimationAction[] | undefined | play 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>
pauseAnimation
▸ pauseAnimation(): void
Returns
void
resumeAnimation
▸ resumeAnimation(): void
Returns
void
stopAnimation
▸ stopAnimation(reset?): void
Parameters
| Name | Type | Default value |
|---|---|---|
reset | boolean | false |
Returns
void
resetAnimation
▸ resetAnimation(): void
Returns
void
_storeKey
▸ Protected _storeKey(prefix?): string
Parameters
| Name | Type |
|---|---|
prefix? | string |
Returns
string
Inherited from
Constructors
constructor
• new GLTFAnimationPlugin()