Skip to main content

AnimationPropertyLayer

Class

A layer containing different properties.

  • 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 v253

A layer containing different properties. Examples include position, rotation, scale or any other arbitrary properties a user would like to add and sample from.

Index

Example

The name of the layer.

//@input Component.AnimationPlayer player

var animationTarget = script.getSceneObject()
var animationAsset = AnimationAsset.create();
var animationLayer = AnimationPropertyLayer.create();

xCurve = AnimationCurve.createEasingCurve(0.0, 0.0, 0.83, 0, 0.17, 1);
yCurve = AnimationCurve.createEasingCurve(0.0, 0.0, 0.83, 0, 0.17, 1);
zCurve = AnimationCurve.createEasingCurve(0.0, 1.57, 0.83, 0, 0.17, 1);

var rotTrack = AnimationPropertyTrack.createQuatFromCurves(xCurve, yCurve, zCurve);

animationLayer.setProperty(AnimationPropertyLayer.TransformRotation, rotTrack);

animationAsset.addLayer(animationTarget.name, animationLayer);

var clip = script.player.getClip("Test");
clip.animation = animationAsset;

Extends

Methods

create()

static create(): AnimationPropertyLayer

Create new animation asset.

Returns

AnimationPropertyLayer

Since

Lens Scripting Version 333


getProperty()

getProperty(name): AnimationPropertyTrack

Gets a property from a layer. Ex. position, scale, rotation, etc.

Parameters

ParameterType
namestring

Returns

AnimationPropertyTrack

Since

Lens Scripting Version 333


getTypeName()

static getTypeName(): TypeName<AnimationPropertyLayer>

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<AnimationPropertyLayer>

Since

Lens Scripting Version 253

Overrides

ScriptObject.getTypeName


getTypeName()

getTypeName(): string

Returns the name of this object's type.

Returns

string

Inherited from

ScriptObject.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

ScriptObject.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

ScriptObject.isSame


removeProperty()

removeProperty(name): void

Deletes a property that exists in the layer.

Parameters

ParameterType
namestring

Returns

void

Since

Lens Scripting Version 333


renameProperty()

renameProperty(oldName, newName): void

Renames a property that already exists in the layer.

Parameters

ParameterType
oldNamestring
newNamestring

Returns

void

Since

Lens Scripting Version 333


setCustomProperty()

setCustomProperty(name, property, callback): void

Sets a custom property for a layer.

Parameters

ParameterType
namestring
propertyAnimationPropertyTrack
callback(name, value) => void

Returns

void

Since

Lens Scripting Version 337


setProperty()

setProperty(name, property): void

Sets a property for a layer.

Parameters

ParameterType
namestring
propertyAnimationPropertyTrack

Returns

void

Since

Lens Scripting Version 333

Nested types

Variables

VariableDescription
BlendShapesAccessor string for BlendsShapes. In order to access a BlendShape track, use the accessor + the track name. Ex. "BlendShapes.JNT_4_HEAD". The delimiter "." separates the accessor and the property name.
TransformPositionAccessor string for Transform Position property.
TransformRotationAccessor string for Transform Rotation property.
TransformScaleAccessor string for Transform Scale property.
VertexCacheAccessor string for VertexCache.
VisibilityAccessor string for Visibility.