API Docs for:
Show:

LS.Animation Class

Module: LS

An Animation is a resource that contains samples of properties over time, similar to animation curves Values could be associated to an specific node. Data is contained in tracks

Constructor

LS.Animation

()

Methods

addTake

(
  • name
)

adds an existing take

Parameters:

assignToNode

(
  • node
)

It creates a PlayAnimation component to the node (or reuse and old existing one). Used when a resource is assigned to a node

Parameters:

createTake

(
  • name
  • duration
)
LS.Animation.Take

Create a new take inside this animation (a take contains all the tracks)

Parameters:

  • name String

    the name

  • duration Number

Returns:

LS.Animation.Take:

the take

getNumTakes

() Number

returns the number of takes

Returns:

Number:

the number of takes

getTake

(
  • name
)
LS.Animation.Take

returns the take with a given name

Parameters:

  • name String

Returns:

LS.Animation.Take:

the take

optimizeTracks

() Number

optimize all the tracks in all the takes, so they take less space and are faster to compute (when possible)

Returns:

Number:

the number of takes

removeTake

(
  • name
)

removes a take

Parameters:

  • name String

renameTake

(
  • old_name
  • new_name
)

renames a take name

Parameters:

  • old_name String
  • new_name String

setTracksPacking

(
  • pack
)
Number

changes the packing mode of the tracks inside all takes

Parameters:

  • pack Boolean

    if true the tracks will be packed (used a typed array)

Returns:

Number:

te number of modifyed tracks