Class AnimationGroup
Hierarchy
- AnimationGroup
Implements
Index
Constructors
Properties
Accessors
Methods
- add
Targeted Animation - clone
- dispose
- get
Class Name - get
Length - go
To Frame - normalize
- pause
- play
- remove
Targeted Animation - remove
Unmasked Animations - reset
- restart
- serialize
- set
Weight For All Animatables - start
- stop
- sync
All Animations With - sync
With Mask - to
String - Clip
Frames - Clip
Frames In Place - Clip
In Place - Clip
Keys - Clip
Keys In Place - Make
Animation Additive - Merge
Animation Groups - Parse
Constructors
constructor
Instantiates a new Animation Group. This helps managing several animations at once.
Parameters
name: string
Defines the name of the group
Optional scene: Nullable<Scene>
Defines the scene the group belongs to
Optional weight: number
Defines the weight to use for animations in the group (-1.0 by default, meaning "no weight")
Optional playOrder: number
Defines the order of play of the animation group (default is 0)
Returns AnimationGroup
Properties
Optional maskSearch playground for mask
Gets or sets the mask associated with this animation group. This mask is used to filter which objects should be animated.
metadataSearch playground for metadata
Gets or sets an object used to store user defined information for the node
nameSearch playground for name
The name of the animation group
on Animation End ObservableSearch playground for onAnimationEndObservable
This observable will notify when one animation have ended
on Animation Group End ObservableSearch playground for onAnimationGroupEndObservable
This observable will notify when all animations have ended.
on Animation Group Loop ObservableSearch playground for onAnimationGroupLoopObservable
Observer raised when all animations have looped
on Animation Group Pause ObservableSearch playground for onAnimationGroupPauseObservable
This observable will notify when all animations have paused.
on Animation Group Play ObservableSearch playground for onAnimationGroupPlayObservable
This observable will notify when all animations are playing.
on Animation Loop ObservableSearch playground for onAnimationLoopObservable
Observer raised when one animation loops
unique IdSearch playground for uniqueId
Gets or sets the unique id of the node
Accessors
animatables
returning the list of animatables controlled by this animation group.
Returns Animatable[]
blending Speed
Gets or sets the animation blending speed Note that a null value means that each animation will use their own existing blending configuration (Animation.blendingSpeed)
Returns Nullable<number>
Gets or sets the animation blending speed Note that a null value means that each animation will use their own existing blending configuration (Animation.blendingSpeed)
Parameters
value: Nullable<number>
Returns void
children
Gets the list of target animations
Returns TargetedAnimation[]
enable Blending
Allows the animations of the animation group to blend with current running animations Note that a null value means that each animation will use their own existing blending configuration (Animation.enableBlending)
Returns Nullable<boolean>
Allows the animations of the animation group to blend with current running animations Note that a null value means that each animation will use their own existing blending configuration (Animation.enableBlending)
Parameters
value: Nullable<boolean>
Returns void
from
Gets the first frame
Returns number
is Additive
Gets or sets if all animations should be evaluated additively
Returns boolean
Gets or sets if all animations should be evaluated additively
Parameters
value: boolean
Returns void
is Playing
Gets a value indicating that the current group is playing
Returns boolean
is Started
Define if the animations are started
Returns boolean
loop Animation
Gets or sets if all animations should loop or not
Returns boolean
Gets or sets if all animations should loop or not
Parameters
value: boolean
Returns void
play Order
Gets or sets the order of play of the animation group (default: 0)
Returns number
Gets or sets the order of play of the animation group (default: 0)
Parameters
value: number
Returns void
speed Ratio
Gets or sets the speed ratio to use for all animations
Returns number
Gets or sets the speed ratio to use for all animations
Parameters
value: number
Returns void
targeted Animations
Gets the targeted animations for this animation group
Returns TargetedAnimation[]
to
Gets the last frame
Returns number
weight
Gets or sets the weight to apply to all animations of the group
Returns number
Gets or sets the weight to apply to all animations of the group
Parameters
value: number
Returns void
Methods
add Targeted AnimationSearch playground for addTargetedAnimation
Add an animation (with its target) in the group
Parameters
animation: Animation
defines the animation we want to add
target: any
defines the target of the animation
Returns TargetedAnimation
the TargetedAnimation object
cloneSearch playground for clone
Clone the current animation group and returns a copy
Parameters
newName: string
defines the name of the new group
Optional targetConverter: ((oldTarget: any) => any)
defines an optional function used to convert current animation targets to new ones
Parameters
oldTarget: any
Returns any
Optional cloneAnimations: boolean
defines if the animations should be cloned or referenced
Returns AnimationGroup
the new animation group
disposeSearch playground for dispose
Dispose all associated resources
Returns void
get Class NameSearch playground for getClassName
Returns the string "AnimationGroup"
Returns string
"AnimationGroup"
get LengthSearch playground for getLength
Gets the length (in seconds) of the animation group This function assumes that all animations are played at the same framePerSecond speed! Note: you can only call this method after you've added at least one targeted animation!
Parameters
Optional from: number
Starting frame range (default is AnimationGroup.from)
Optional to: number
Ending frame range (default is AnimationGroup.to)
Returns number
The length in seconds
go To FrameSearch playground for goToFrame
Goes to a specific frame in this animation group
Parameters
frame: number
the frame number to go to
Returns AnimationGroup
the animationGroup
normalizeSearch playground for normalize
This function will normalize every animation in the group to make sure they all go from beginFrame to endFrame It can add constant keys at begin or end
Parameters
Optional beginFrame: Nullable<number>
defines the new begin frame for all animations or the smallest begin frame of all animations if null (defaults to null)
Optional endFrame: Nullable<number>
defines the new end frame for all animations or the largest end frame of all animations if null (defaults to null)
Returns AnimationGroup
the animation group
pauseSearch playground for pause
Pause all animations
Returns AnimationGroup
the animation group
playSearch playground for play
Play all animations to initial state This function will start() the animations if they were not started or will restart() them if they were paused
Parameters
Optional loop: boolean
defines if animations must loop
Returns AnimationGroup
the animation group
remove Targeted AnimationSearch playground for removeTargetedAnimation
Remove an animation from the group
Parameters
animation: Animation
defines the animation we want to remove
Returns void
remove Unmasked AnimationsSearch playground for removeUnmaskedAnimations
Removes all animations for the targets not retained by the animation group mask. Use this function if you know you won't need those animations anymore and if you want to free memory.
Returns void
resetSearch playground for reset
Reset all animations to initial state
Returns AnimationGroup
the animation group
restartSearch playground for restart
Restart animations from key 0
Returns AnimationGroup
the animation group
serializeSearch playground for serialize
Serializes the animationGroup to an object
Returns any
Serialized object
set Weight For All AnimatablesSearch playground for setWeightForAllAnimatables
Set animation weight for all animatables
Parameters
weight: number
defines the weight to use
Returns AnimationGroup
the animationGroup
startSearch playground for start
Start all animations on given targets
Parameters
Optional loop: boolean
defines if animations must loop
Optional speedRatio: number
defines the ratio to apply to animation speed (1 by default)
Optional from: number
defines the from key (optional)
Optional to: number
defines the to key (optional)
Optional isAdditive: boolean
defines the additive state for the resulting animatables (optional)
Returns AnimationGroup
the current animation group
stopSearch playground for stop
Stop all animations
Returns AnimationGroup
the animation group
sync All Animations WithSearch playground for syncAllAnimationsWith
Synchronize and normalize all animatables with a source animatable
Parameters
root: Nullable<Animatable>
defines the root animatable to synchronize with (null to stop synchronizing)
Returns AnimationGroup
the animationGroup
sync With MaskSearch playground for syncWithMask
Makes sure that the animations are either played or stopped according to the animation group mask. Note however that the call won't have any effect if the animation group has not been started yet. You should call this function if you modify the mask after the animation group has been started.
Returns void
to StringSearch playground for toString
Creates a detailed string about the object
Parameters
Optional fullDetails: boolean
defines if the output string will support multiple levels of logging within scene loading
Returns string
a string representing the object
Static Clip FramesSearch playground for ClipFrames
Creates a new animation, keeping only the frames that are inside a given frame range
Parameters
sourceAnimationGroup: AnimationGroup
defines the animation group on which to operate
fromFrame: number
defines the lower bound of the range
toFrame: number
defines the upper bound of the range
Optional name: string
defines the name of the new animation group. If not provided, use the same name as animationGroup
Optional dontCloneAnimations: boolean
defines whether or not the animations should be cloned before clipping the frames. Default is false, so animations will be cloned
Returns AnimationGroup
a new animation group stripped from all the frames outside the given range
Static Clip Frames In PlaceSearch playground for ClipFramesInPlace
Updates an existing animation, keeping only the frames that are inside a given frame range
Parameters
animationGroup: AnimationGroup
defines the animation group on which to operate
fromFrame: number
defines the lower bound of the range
toFrame: number
defines the upper bound of the range
Optional dontCloneAnimations: boolean
defines whether or not the animations should be cloned before clipping the frames. Default is false, so animations will be cloned
Returns AnimationGroup
the animationGroup stripped from all the frames outside the given range
Static Clip In PlaceSearch playground for ClipInPlace
Updates an existing animation, keeping only the keys that are inside a given key or frame range
Parameters
animationGroup: AnimationGroup
defines the animation group on which to operate
start: number
defines the lower bound of the range
end: number
defines the upper bound of the range
Optional dontCloneAnimations: boolean
defines whether or not the animations should be cloned before clipping the keys. Default is false, so animations will be cloned
Optional useFrame: boolean
defines if the range is defined by frame numbers or key indices (default is false which means use key indices)
Returns AnimationGroup
the animationGroup stripped from all the keys outside the given range
Static Clip KeysSearch playground for ClipKeys
Creates a new animation, keeping only the keys that are inside a given key range
Parameters
sourceAnimationGroup: AnimationGroup
defines the animation group on which to operate
fromKey: number
defines the lower bound of the range
toKey: number
defines the upper bound of the range
Optional name: string
defines the name of the new animation group. If not provided, use the same name as animationGroup
Optional dontCloneAnimations: boolean
defines whether or not the animations should be cloned before clipping the keys. Default is false, so animations will be cloned
Returns AnimationGroup
a new animation group stripped from all the keys outside the given range
Static Clip Keys In PlaceSearch playground for ClipKeysInPlace
Updates an existing animation, keeping only the keys that are inside a given key range
Parameters
animationGroup: AnimationGroup
defines the animation group on which to operate
fromKey: number
defines the lower bound of the range
toKey: number
defines the upper bound of the range
Optional dontCloneAnimations: boolean
defines whether or not the animations should be cloned before clipping the keys. Default is false, so animations will be cloned
Returns AnimationGroup
the animationGroup stripped from all the keys outside the given range
Static Make Animation AdditiveSearch playground for MakeAnimationAdditive
Convert the keyframes for all animations belonging to the group to be relative to a given reference frame.
Parameters
sourceAnimationGroup: AnimationGroup
defines the AnimationGroup containing animations to convert
referenceFrame: number
defines the frame that keyframes in the range will be relative to (default: 0)
Optional range: string
defines the name of the AnimationRange belonging to the animations in the group to convert
Optional cloneOriginal: boolean
defines whether or not to clone the group and convert the clone or convert the original group (default is false)
Optional clonedName: string
defines the name of the resulting cloned AnimationGroup if cloneOriginal is true
Returns AnimationGroup
a new AnimationGroup if cloneOriginal is true or the original AnimationGroup if cloneOriginal is false
Convert the keyframes for all animations belonging to the group to be relative to a given reference frame.
Parameters
sourceAnimationGroup: AnimationGroup
defines the AnimationGroup containing animations to convert
Optional options: IMakeAnimationGroupAdditiveOptions
defines the options to use when converting ey keyframes
Returns AnimationGroup
a new AnimationGroup if options.cloneOriginalAnimationGroup is true or the original AnimationGroup if options.cloneOriginalAnimationGroup is false
Static Merge Animation GroupsSearch playground for MergeAnimationGroups
Merge the array of animation groups into a new animation group
Parameters
animationGroups: AnimationGroup[]
List of animation groups to merge
Optional disposeSource: boolean
If true, animation groups will be disposed after being merged (default: true)
Optional normalize: boolean
If true, animation groups will be normalized before being merged, so that all animations have the same "from" and "to" frame (default: false)
Optional weight: number
Weight for the new animation group. If not provided, it will inherit the weight from the first animation group of the array
Returns Nullable<AnimationGroup>
The new animation group or null if no animation groups were passed
Static ParseSearch playground for Parse
Returns a new AnimationGroup object parsed from the source provided.
Parameters
parsedAnimationGroup: any
defines the source
scene: Scene
defines the scene that will receive the animationGroup
Returns AnimationGroup
a new AnimationGroup
Use this class to create coordinated animations on multiple targets