Skip to main content

AnimationCurveTrack

Class

Container for one or more AnimationCurves.

  • Available on all platforms
Platform details: Snapchat, SPECS, Camera Kit Web, Camera Kit Mobile fully supported.

Platform details

  • Snapchat — Fully supported.

  • SPECS — Fully supported.

  • Camera Kit Web — Fully supported.

  • Camera Kit Mobile — Fully supported.

Since Lens Scripting v234

Container for one or more AnimationCurves. Can be sampled to drive attributes (e.g. animation, vfx, code etc.)

Index

Remarks

When evaluating multiple values, the values are selected from left to right in order. For example, for a vec3 containing x,y,z it will correspond to track index 0, 1, 2 from left to right.

Extends

Properties

name

name: string

The name of the Asset in Lens Studio.

Default Value

""

Inherited from

AnimationTrack.name


uniqueIdentifier

readonly uniqueIdentifier: string

Since

Lens Scripting Version 176

Inherited from

AnimationTrack.uniqueIdentifier

Methods

create()

static create(name): AnimationCurveTrack

Create new animation curve track.

Parameters

ParameterType
namestring

Returns

AnimationCurveTrack

Since

Lens Scripting Version 299


evaluateNumber()

evaluateNumber(time): number

Samples the track at the given time to get some value.

Parameters

ParameterType
timenumber

Returns

number

Since

Lens Scripting Version 234


evaluateRotation()

evaluateRotation(time): quat

Samples the track at the given time to get some value. Returns 0 for non-existent channels.

Parameters

ParameterType
timenumber

Returns

quat

Since

Lens Scripting Version 234


evaluateVec2()

evaluateVec2(time): vec2

Samples the track at the given time to get some value. Returns 0 for non-existent channels.

Parameters

ParameterType
timenumber

Returns

vec2

Since

Lens Scripting Version 234


evaluateVec3()

evaluateVec3(time): vec3

Samples the track at the given time to get some value. Returns 0 for non-existent channels.

Parameters

ParameterType
timenumber

Returns

vec3

Since

Lens Scripting Version 234


evaluateVec4()

evaluateVec4(time): vec4

Samples the track at the given time to get some value. Returns 0 for non-existent channels.

Parameters

ParameterType
timenumber

Returns

vec4

Since

Lens Scripting Version 234


getProperties()

getProperties(): AnimationCurve[]

Retrieves all properties.

Returns

AnimationCurve[]

Since

Lens Scripting Version 333


getProperty()

getProperty(key): AnimationCurve

Retrieves an AnimationCurve associated with the given key.

Parameters

ParameterType
keystring

Returns

AnimationCurve

Since

Lens Scripting Version 234


getPropertyKeys()

getPropertyKeys(): string[]

Returns an array of strings, which are the names of properties associated with the AnimationCurveTrack.

Returns

string[]

Since

Lens Scripting Version 234


getTypeName()

static getTypeName(): TypeName<AnimationCurveTrack>

Returns the fully-qualified JavaScript type name for this class (for example, "Component.Camera"). This is a static accessor (no instance required) and returns the same value as the instance getTypeName().

Returns

TypeName<AnimationCurveTrack>

Since

Lens Scripting Version 234

Overrides

AnimationTrack.getTypeName


getTypeName()

getTypeName(): string

Returns the name of this object's type.

Returns

string

Inherited from

AnimationTrack.getTypeName


isOfType()

isOfType(type): boolean

Returns true if the object matches or derives from the passed in type.

Parameters

ParameterType
typestring

Returns

boolean

Inherited from

AnimationTrack.isOfType


isSame()

isSame(other): boolean

Returns true if this object is the same as other. Useful for checking if two references point to the same thing.

Parameters

ParameterType
otherScriptObject

Returns

boolean

Inherited from

AnimationTrack.isSame


setProperty()

setProperty(key, curve): void

Sets an AnimationCurve to a given key.

Parameters

ParameterType
keystring
curveAnimationCurve

Returns

void

Since

Lens Scripting Version 234