Skip to main content

Class: CustomAnimationHelperPlugin

Plugins.CustomAnimationHelperPlugin

AnimationHelperPlugin is used internally by plugins to keep track of all helpers and allows to animate its clips For internal use only at the moment.

Hierarchy​

Properties​

PluginType​

▪ Static Readonly PluginType: "AnimationHelperPlugin"


enabled​

• enabled: boolean

Overrides​

AViewerPlugin.enabled


helperIdentities​

• helperIdentities: Map<any, any>

It stores all the helpers as the value with its appropriate names as the key


_dirty​

• Protected _dirty: boolean = false

Inherited from​

AViewerPlugin._dirty


_viewer​

• Protected Optional _viewer: ViewerApp

Inherited from​

AViewerPlugin._viewer

Accessors​

dirty​

• get dirty(): boolean

Returns​

boolean

Inherited from​

AViewerPlugin.dirty

• set dirty(value): void

Parameters​

NameType
valueboolean

Returns​

void

Inherited from​

AViewerPlugin.dirty


viewer​

• get viewer(): undefined | ViewerApp

Returns​

undefined | ViewerApp

Inherited from​

AViewerPlugin.viewer

Methods​

onDispose​

▸ onDispose(viewer): Promise<void>

Parameters​

NameType
viewerViewerApp

Returns​

Promise<void>

Inherited from​

AViewerPlugin.onDispose


onRemove​

▸ onRemove(viewer): Promise<void>

Parameters​

NameType
viewerViewerApp

Returns​

Promise<void>

Inherited from​

AViewerPlugin.onRemove


toJSON​

▸ toJSON(meta?): any

Parameters​

NameType
meta?any

Returns​

any

Inherited from​

AViewerPlugin.toJSON


fromJSON​

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

Parameters​

NameType
dataany
meta?any

Returns​

null | CustomAnimationHelperPlugin | Promise<null | CustomAnimationHelperPlugin>

Inherited from​

AViewerPlugin.fromJSON


exportState​

▸ exportState(): any

Returns​

any

Inherited from​

AViewerPlugin.exportState


importState​

▸ importState(state): Promise<void>

Parameters​

NameType
stateany

Returns​

Promise<void>

Inherited from​

AViewerPlugin.importState


storeState​

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

Parameters​

NameType
prefix?string
storage?Storage
data?any

Returns​

void

Inherited from​

AViewerPlugin.storeState


loadState​

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

Parameters​

NameType
prefix?string
storage?Storage

Returns​

Promise<void>

Inherited from​

AViewerPlugin.loadState


onAdded​

▸ onAdded(viewer): Promise<void>

It is used by Parent Class(no need to change the parameter)

Parameters​

NameTypeDescription
viewerViewerAppdefault viewer that is maintained through out the api(no need to change the parameter)

Returns​

Promise<void>

Overrides​

AViewerPlugin.onAdded


createHelper​

▸ createHelper(id, model): void

Creates a new AnimationHelper that manages its own state

Parameters​

NameTypeDescription
idstringhelper name of the model
modelObject3D<Object3DEventMap>3d model to pass on

Returns​

void


getAnimationClips​

▸ getAnimationClips(id): any

returns the animationClips of the 3D model

Parameters​

NameTypeDescription
idstringhelper name of the model

Returns​

any


playClip​

▸ playClip(id, clip, loop, timescale?, reverse?, resetTime?): Promise<void>

Plays the single clip from the Helper of a 3D model

Parameters​

NameTypeDefault valueDescription
idstringundefinedhelper name of 3D model
clipAnimationClipundefinedAnimation Clip of the 3D model that needs to be played
loopbooleanundefineddefault is 'false', if the clip needs to be looped continously then set it to 'true'
timescalenumber1timescale of the animation clip that will played. Default is 1
reversebooleanfalseto reverse the clip set it to true. Default is false
resetTimebooleanfalseresets the mixer time. Default is false

Returns​

Promise<void>


playAllAnimations​

▸ playAllAnimations(id, loop): Promise<void>

Plays all the animation clips that are present in the 3D model

Parameters​

NameTypeDescription
idstringhelper name of 3D model
loopbooleandefault is 'false', if the clip needs to be looped continously then set it to 'true'

Returns​

Promise<void>


playAllAnimationsInReverse​

▸ playAllAnimationsInReverse(id, loop): Promise<void>

Reverses all the animation clips that are present in the 3D model

Parameters​

NameTypeDescription
idstringhelper name of 3D model
loopbooleandefault is 'false', if the clip needs to be looped continously then set it to 'true'

Returns​

Promise<void>


playAnimationByName​

▸ playAnimationByName(id, name, loop, timescale?, reverse?): Promise<void>

Plays the clip by its name from the Helper of a 3D model

Parameters​

NameTypeDefault valueDescription
idstringundefinedhelper name of 3D model
namestringundefinedname of the animation clip that is present in 3D model
loopfalseundefineddefault is 'false', if the clip needs to be looped continously then set it to 'true'
timescalenumber1timescale of the animation clip that will played. Default is 1
reversebooleanfalseto reverse the clip set it to true. Default is false

Returns​

Promise<void>


_storeKey​

▸ Protected _storeKey(prefix?): string

Parameters​

NameType
prefix?string

Returns​

string

Inherited from​

AViewerPlugin._storeKey

Constructors​

constructor​

• new CustomAnimationHelperPlugin()

Overrides​

AViewerPlugin.constructor