LS.Animation.Take Class
Represents a set of animations
Constructor
LS.Animation.Take
()
Item Index
Properties
Methods
applyTracks
-
current_time
-
last_time
-
ignore_interpolation
-
weight
-
root
-
on_pre_apply
-
on_apply_sample
For every track, gets the interpolated value between keyframes and applies the value to the property associated with the track locator Locators are in the form of "{NODE_UID}/{COMPONENT_UID}/{property_name}"
Parameters:
-
current_time
Numberthe time of the anim to sample
-
last_time
Numberthis is used for events, we need to know where you were before
-
ignore_interpolation
Booleanin case you want to sample the nearest one
-
weight
SceneNode[Optional] allows to blend animations with current value (default is 1)
-
root
Number[Optional] if you want to limit the locator to search inside a node
-
on_pre_apply
Function[Optional] a callback called per track to see if this track should be applyed, if it returns false it is skipped. callback receives (track, current_time, root_node, weight)
-
on_apply_sample
Function[Optional] a callback called before applying a keyframe, if the callback returns false the keyframe will be skipped. callback parameters ( track, sample, root_node, weight )
Returns:
the target where the action was performed
createTrack
-
data
creates a new track from a given data
Parameters:
-
data
Objectin serialized format
Returns:
the track
onlyRotations
()
If this is a transform track it removes translation and scale leaving only rotations
optimizeTracks
()
Optimizes the tracks by changing the Matrix tracks to Trans10 tracks which are way faster and use less space
removeScaling
()
removes scaling in transform tracks