AnimationPropertyTrack
ClassInterface class for typed property tracks.
- Available on all platforms
Index
Methods
Extends
Extended by
Vec4CurveAnimationPropertyTrackVec3CurveAnimationPropertyTrackVec3AnimationPropertyTrackVec2CurveAnimationPropertyTrackQuatSlerpAnimationPropertyTrackQuatAnimationPropertyTrackIntStepAnimationPropertyTrackIntAnimationPropertyTrackFloatCurveAnimationPropertyTrackFloatAnimationPropertyTrack
Methods
addKeyFrame()
addKeyFrame(
channels,t):void
Interface function for typed property tracks.
Parameters
| Parameter | Type |
|---|---|
channels | AnimationKeyFrame[] |
t | number |
Returns
void
createFloatFromCurves()
staticcreateFloatFromCurves(x):AnimationPropertyTrack
Creates a FloatCurvePropertyTrack. Stores and samples explicit curves.
Parameters
| Parameter | Type |
|---|---|
x | AnimationCurve |
Returns
AnimationPropertyTrack
Since
Lens Scripting Version 333
createQuatFromCurves()
staticcreateQuatFromCurves(x,y,z):AnimationPropertyTrack
Creates a QuatPropertyTrack. Samples down curves at 30 FPS and uses SLERP.
Parameters
| Parameter | Type |
|---|---|
x | AnimationCurve |
y | AnimationCurve |
z | AnimationCurve |
Returns
AnimationPropertyTrack
Since
Lens Scripting Version 333
createQuatFromSlerp()
staticcreateQuatFromSlerp(from,to,progress):AnimationPropertyTrack
Creates a track that spherically interpolates (SLERP) a rotation directly from from to to,
with progress (an AnimationCurve normally spanning 0 to 1) driving the interpolation
factor over time. Because it interpolates in quaternion space, it follows the shortest arc
between the two orientations -- unlike AnimationPropertyTrack.createQuatFromCurves, which
interpolates per-axis in Euler space and can take the long way around. progress values outside
0 to 1 extrapolate along the same geodesic, which allows overshoot/anticipation easing.
Parameters
| Parameter | Type |
|---|---|
from | quat |
to | quat |
progress | AnimationCurve |
Returns
AnimationPropertyTrack
Since
Lens Scripting Version 381
Example
var from = quat.fromEulerAngles(0, 0, 0);
var to = quat.fromEulerAngles(0, 0, 350 * (Math.PI / 180)); // shortest arc is 10 degrees
var progress = AnimationCurve.createEasingCurve(0.0, 1.0, 0.83, 0, 0.17, 1);
var track = AnimationPropertyTrack.createQuatFromSlerp(from, to, progress);
var layer = AnimationPropertyLayer.create();
layer.setProperty(AnimationPropertyLayer.TransformRotation, track);
createVec2FromCurves()
staticcreateVec2FromCurves(x,y):AnimationPropertyTrack
Creates a Vec2CurvePropertyTrack. Stores and samples explicit curves.
Parameters
| Parameter | Type |
|---|---|
x | AnimationCurve |
y | AnimationCurve |
Returns
AnimationPropertyTrack
Since
Lens Scripting Version 381
Example
var xCurve = AnimationCurve.createEasingCurve(0.0, 0.0, 0.83, 0, 0.17, 1);
var yCurve = AnimationCurve.createEasingCurve(0.0, 1.0, 0.83, 0, 0.17, 1);
var track = AnimationPropertyTrack.createVec2FromCurves(xCurve, yCurve);
var layer = AnimationPropertyLayer.create();
layer.setCustomProperty("uvOffset", track, function (name, value) {
// value is a vec2 sampled from the curves
});
createVec3FromCurves()
staticcreateVec3FromCurves(x,y,z):AnimationPropertyTrack
Creates a Vec3CurvePropertyTrack. Stores and samples explicit curves.
Parameters
| Parameter | Type |
|---|---|
x | AnimationCurve |
y | AnimationCurve |
z | AnimationCurve |
Returns
AnimationPropertyTrack
Since
Lens Scripting Version 333
createVec4FromCurves()
staticcreateVec4FromCurves(x,y,z,w):AnimationPropertyTrack
Creates a Vec4CurvePropertyTrack. Stores and samples explicit curves.
Parameters
| Parameter | Type |
|---|---|
x | AnimationCurve |
y | AnimationCurve |
z | AnimationCurve |
w | AnimationCurve |
Returns
AnimationPropertyTrack
Since
Lens Scripting Version 381
Example
var xCurve = AnimationCurve.createEasingCurve(0.0, 0.0, 0.83, 0, 0.17, 1);
var yCurve = AnimationCurve.createEasingCurve(0.0, 0.0, 0.83, 0, 0.17, 1);
var zCurve = AnimationCurve.createEasingCurve(0.0, 0.0, 0.83, 0, 0.17, 1);
var wCurve = AnimationCurve.createEasingCurve(0.0, 1.0, 0.83, 0, 0.17, 1);
var track = AnimationPropertyTrack.createVec4FromCurves(xCurve, yCurve, zCurve, wCurve);
var layer = AnimationPropertyLayer.create();
layer.setCustomProperty("tintColor", track, function (name, value) {
// value is a vec4 sampled from the curves
});
getTypeName()
staticgetTypeName():TypeName<AnimationPropertyTrack>
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<AnimationPropertyTrack>
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
removeKeyFrame()
removeKeyFrame(
t):void
Interface function for typed property tracks.
Parameters
| Parameter | Type |
|---|---|
t | number |
Returns
void