AnimationPropertyLayer
ClassA layer containing different properties.
- Available on all platforms
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
Methods
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()
staticcreate():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
| Parameter | Type |
|---|---|
name | string |
Returns
Since
Lens Scripting Version 333
getTypeName()
staticgetTypeName():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
getTypeName()
getTypeName():
string
Returns the name of this object's type.
Returns
string
Inherited from
isOfType()
isOfType(
type):boolean
Returns true if the object matches or derives from the passed in type.
Parameters
| Parameter | Type |
|---|---|
type | string |
Returns
boolean
Inherited from
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
| Parameter | Type |
|---|---|
other | ScriptObject |
Returns
boolean
Inherited from
removeProperty()
removeProperty(
name):void
Deletes a property that exists in the layer.
Parameters
| Parameter | Type |
|---|---|
name | string |
Returns
void
Since
Lens Scripting Version 333
renameProperty()
renameProperty(
oldName,newName):void
Renames a property that already exists in the layer.
Parameters
| Parameter | Type |
|---|---|
oldName | string |
newName | string |
Returns
void
Since
Lens Scripting Version 333
setCustomProperty()
setCustomProperty(
name,property,callback):void
Sets a custom property for a layer.
Parameters
| Parameter | Type |
|---|---|
name | string |
property | AnimationPropertyTrack |
callback | (name, value) => void |
Returns
void
Since
Lens Scripting Version 337
setProperty()
setProperty(
name,property):void
Sets a property for a layer.
Parameters
| Parameter | Type |
|---|---|
name | string |
property | AnimationPropertyTrack |
Returns
void
Since
Lens Scripting Version 333
Nested types
Variables
| Variable | Description |
|---|---|
| BlendShapes | Accessor 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. |
| TransformPosition | Accessor string for Transform Position property. |
| TransformRotation | Accessor string for Transform Rotation property. |
| TransformScale | Accessor string for Transform Scale property. |
| VertexCache | Accessor string for VertexCache. |
| Visibility | Accessor string for Visibility. |