API Docs for:
Show:

LS.Animation.Take Class

Represents a set of animations

Constructor

LS.Animation.Take

()

Methods

applyTracks

(
  • current_time
  • last_time
  • ignore_interpolation
  • weight
  • root
  • on_pre_apply
  • on_apply_sample
)
Component

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 Number

    the time of the anim to sample

  • last_time Number

    this is used for events, we need to know where you were before

  • ignore_interpolation Boolean

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

Component:

the target where the action was performed

createTrack

(
  • data
)
LS.Animation.Track

creates a new track from a given data

Parameters:

  • data Object

    in serialized format

Returns:

LS.Animation.Track:

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

Properties

duration in seconds

Number

name

String

tracks

Array