Adds some noise to a value.
You may use seedRandom() before using this function as it will influence the generated noise.
A timeless noise can be achieved with seedRandom(index,true) for example.
Parameters:
Name
Type
Description
val
number
|
Array.<number>
The value to add noise to.
quantity
float
The quantity of noise. A percentage. 100 means the value can range from (val * 0) to (val * 2).
seedRandom(index, true) // a timeless noise
addNoise(value, 50 ); // the property value will have noise between (value * 0.5) and (value * 1.5) which won't vary through time.
seedRandom(index, false);
addNoise(value, 33 ); // the noise will change at each frame, varying between (value * .66) and (value * 1.33)
The keyframes. An object with four properties: value The value of the keyframe time The time of the keyframe interpolation (optional. Default: linear) A function taking 5 arguments to interpolate between this keyframe and the next one params (optional.) A sixth argument passed to the interpolation function. To be used with DuAEF interpolations.
Note that the keyframes must be sorted. The function does not sort them, as it would have a bad impact on performance.
Interpolates a value with a bezier curve.
This method can replace linear() and ease() with a custom bézier interpolation.
Parameters:
Name
Type
Attributes
Default
Description
t
number
The value to interpolate
tMin
number
<optional>
0
The minimum value of the initial range
tMax
number
<optional>
1
The maximum value of the initial range
value1
number
<optional>
0
The minimum value of the interpolated result
value2
number
<optional>
1
The maximum value of the interpolated result
bezierPoints
Array.<number>
<optional>
[0.33,0.0,0.66,1.0]
an Array of 4 coordinates wihtin the [0.0, 1.0] range which describes the Bézier interpolation. The default mimics the native ease() function
[ outTangentX, outTangentY, inTangentX, inTangentY ]
The time at which the value must be got. To end the loop, pass the same time for all subsequent frames.
elasticity
float
The elasticity, which controls the amplitude and frequence according to the last known velocity
damping
float
Damping
vAtTime
function
<optional>
valueAtTime
A function to replace valueAtTime. Use this to loop after an expression+keyframe controlled animation, by providing a function used to generate the animation.
Checks the type of a pseudo-effect used by Duik.
This is a workaround for the missing matchName in expressions.
Pseudo-Effects used by Duik start with a hidden property which name is the same as the matchName of the effect itself (without the 'Pseudo/' part).
Parameters:
Name
Type
Description
fx
Property
The effect to check
duikMatchName
string
The matchName of a pseudo-effect used by Duik (without the 'Pseudo/' part)
True when the property at propIndex is named propName
boolean
Example
if ( checkEffect(thisLayer.effect(1), "DUIK parentConstraint2") ) { "This is the second version of the parent constraint by Duik" }
else { "Who knows what this is?" }
Checks the type of an effect.
This is a workaround for the missing matchName in expressions.
It checks if the given effect has a specific property at a specific index.
Parameters:
Name
Type
Description
fx
Property
The effect to check
propIndex
int
The index of the property
propName
string
The expected name of the property. Be careful with the internationalization of After Effects...
#static
"cycleIn"(t, nK, o, vAtTimeopt, dampingopt) → {float|Array.<float>}
Animatable equivalent to loopIn('cycle') and loopIn('offset').
Parameters:
Name
Type
Attributes
Default
Description
t
float
The time at which the value must be got. To end the loop, pass the same time for all previous frames.
nK
int
The number of keyframes to loop. Use 0 to loop all keyframes
o
Boolean
Wether to offset or cycle
vAtTime
function
<optional>
valueAtTime
A function to replace valueAtTime. Use this to loop after an expression+keyframe controlled animation, by providing a function used to generate the animation.
#static
"cycleOut"(t, nK, o, vAtTimeopt, dampingopt) → {float|Array.<float>}
Animatable equivalent to loopOut('cycle') and loopOut('offset').
Parameters:
Name
Type
Attributes
Default
Description
t
float
The time at which the value must be got. To end the loop, pass the same time for all subsequent frames.
nK
int
The number of keyframes to loop. Use 0 to loop all keyframes
o
Boolean
Wether to offset or cycle
vAtTime
function
<optional>
valueAtTime
A function to replace valueAtTime. Use this to loop after an expression+keyframe controlled animation, by providing a function used to generate the animation.
Removes the ancestors rotation from the rotation of a layer.
This is very useful to make a layer keep its orientation without being influenced by its parents.
Removes the ancestors scale from the scale of a layer.
This is very useful to make a layer keep its scale without being influenced by its parents.
Note that for performance reasons with expressions, even if the parameters of the function are documented with optional/default values, you MUST provide ALL the arguments when using them.
Interpolates a value with an exponential function.
This method can replace linear() and ease() with a gaussian interpolation.
Note that for performance reasons with expressions, even if the parameters of the function are documented with optional/default values, you MUST provide ALL the arguments when using them.
Converts the point coordinates from the current group in the shape layer to the Layer.
Use toWorld and toComp with the result if you need te coordinates in the world or the comp.
Parameters:
Name
Type
Description
point
Array.<number>
The 2D coordinates of the point in the current group.
Converts the point coordinates from Layer to the current group in the shape layer.
Use fromWorld or fromComp first if you need to convert from the world or composition coordinates, and pass the result to this function.
Interpolates a value with a gaussian function.
This method can replace linear() and ease() with a gaussian interpolation.
Note that for performance reasons with expressions, even if the parameters of the function are documented with optional/default values, you MUST provide ALL the arguments when using them.
Gets the "real" scale of a layer, resulting to its scale property, the scale of its parents, and it's location in Z-space if it's 3D.
Note that for performance reasons with expressions, even if the parameters of the function are documented with optional/default values, you MUST provide ALL the arguments when using them.
Gets the transformation Matrix for the current group in a shape layer, including the transformation from the ancestor groups
Note that for performance reasons with expressions, even if the parameters of the function are documented with optional/default values, you MUST provide ALL the arguments when using them.
Gets the world position of a layer.
Note that for performance reasons with expressions, even if the parameters of the function are documented with optional/default values, you MUST provide ALL the arguments when using them.
Gets the world instant velocity of a layer.
Note that for performance reasons with expressions, even if the parameters of the function are documented with optional/default values, you MUST provide ALL the arguments when using them.
Gets the world orientation of a (2D) layer at a specific time.
Note that for performance reasons with expressions, even if the parameters of the function are documented with optional/default values, you MUST provide ALL the arguments when using them.
Gets the world velocity of a property.
Note that for performance reasons with expressions, even if the parameters of the function are documented with optional/default values, you MUST provide ALL the arguments when using them.
An object with two properties:
- `inside (bool)` is true if the point is inside the polygon
- `closestVertex` is the index of the closest vertex of the polygon
Checks if a property is a transform.position property.
Note that for performance reasons with expressions, even if the parameters of the function are documented with optional/default values, you MUST provide ALL the arguments when using them.
Interpolates a value with a linear function, but also extrapolates it outside of known values.
This method can replace linear(), adding extrapolation.
Note that for performance reasons with expressions, even if the parameters of the function are documented with optional/default values, you MUST provide ALL the arguments when using them.
Interpolates a value with a logarithmic function.
This method can replace linear() and ease() with a gaussian interpolation.
Note that for performance reasons with expressions, even if the parameters of the function are documented with optional/default values, you MUST provide ALL the arguments when using them.
Overshoot animation, to be used when the speed is 0.
Parameters:
Name
Type
Attributes
Default
Description
t
float
The time at which the value must be got. To end the loop, pass the same time for all subsequent frames.
elasticity
float
The elasticity, which controls the amplitude and frequence according to the last known velocity
damping
float
Damping
vAtTime
function
<optional>
valueAtTime
A function to replace valueAtTime. Use this to loop after an expression+keyframe controlled animation, by providing a function used to generate the animation.
The time at which the value must be got. To end the loop, pass the same time for all previous frames.
nK
int
The number of keyframes to loop. Use 0 to loop all keyframes
vAtTime
function
<optional>
valueAtTime
A function to replace valueAtTime. Use this to loop after an expression+keyframe controlled animation, by providing a function used to generate the animation.
Animatable equivalent to loopOut('pingpong').
Note that for performance reasons with expressions, even if the parameters of the function are documented with optional/default values, you MUST provide ALL the arguments when using them.
Parameters:
Name
Type
Attributes
Default
Description
t
float
The time at which the value must be got. To end the loop, pass the same time for all subsequent frames.
nK
int
The number of keyframes to loop. Use 0 to loop all keyframes
vAtTime
function
<optional>
valueAtTime
A function to replace valueAtTime. Use this to loop after an expression+keyframe controlled animation, by providing a function used to generate the animation.
Translates a point with a layer, as if it was parented to it.
Note that for performance reasons with expressions, even if the parameters of the function are documented with optional/default values, you MUST provide ALL the arguments when using them.
Parameters:
Name
Type
Attributes
Default
Description
l
Layer
The layer to get the translation from.
point
Array.<float>
<optional>
[0,0]
The [X,Y] point to translate (using world coordinates).
Generates a "zero" value for the current property, i.e. 0 or [0,0], etc. according to the property type.
Note that for path properties, this method returns a path object with three array attributes: points, inTangents, outTangents.
Adds some noise to a value.
You may use seedRandom() before using this function as it will influence the generated noise.
A timeless noise can be achieved with seedRandom(index,true) for example.
Parameters:
Name
Type
Description
val
number
|
Array.<number>
The value to add noise to.
quantity
float
The quantity of noise. A percentage. 100 means the value can range from (val * 0) to (val * 2).
seedRandom(index, true) // a timeless noise
addNoise(value, 50 ); // the property value will have noise between (value * 0.5) and (value * 1.5) which won't vary through time.
seedRandom(index, false);
addNoise(value, 33 ); // the noise will change at each frame, varying between (value * .66) and (value * 1.33)
The keyframes. An object with four properties: value The value of the keyframe time The time of the keyframe interpolation (optional. Default: linear) A function taking 5 arguments to interpolate between this keyframe and the next one params (optional.) A sixth argument passed to the interpolation function. To be used with DuAEF interpolations.
Note that the keyframes must be sorted. The function does not sort them, as it would have a bad impact on performance.
Interpolates a value with a bezier curve.
This method can replace linear() and ease() with a custom bézier interpolation.
Parameters:
Name
Type
Attributes
Default
Description
t
number
The value to interpolate
tMin
number
<optional>
0
The minimum value of the initial range
tMax
number
<optional>
1
The maximum value of the initial range
value1
number
<optional>
0
The minimum value of the interpolated result
value2
number
<optional>
1
The maximum value of the interpolated result
bezierPoints
Array.<number>
<optional>
[0.33,0.0,0.66,1.0]
an Array of 4 coordinates wihtin the [0.0, 1.0] range which describes the Bézier interpolation. The default mimics the native ease() function
[ outTangentX, outTangentY, inTangentX, inTangentY ]
The time at which the value must be got. To end the loop, pass the same time for all subsequent frames.
elasticity
float
The elasticity, which controls the amplitude and frequence according to the last known velocity
damping
float
Damping
vAtTime
function
<optional>
valueAtTime
A function to replace valueAtTime. Use this to loop after an expression+keyframe controlled animation, by providing a function used to generate the animation.
Checks the type of a pseudo-effect used by Duik.
This is a workaround for the missing matchName in expressions.
Pseudo-Effects used by Duik start with a hidden property which name is the same as the matchName of the effect itself (without the 'Pseudo/' part).
Parameters:
Name
Type
Description
fx
Property
The effect to check
duikMatchName
string
The matchName of a pseudo-effect used by Duik (without the 'Pseudo/' part)
True when the property at propIndex is named propName
boolean
Example
if ( checkEffect(thisLayer.effect(1), "DUIK parentConstraint2") ) { "This is the second version of the parent constraint by Duik" }
else { "Who knows what this is?" }
Checks the type of an effect.
This is a workaround for the missing matchName in expressions.
It checks if the given effect has a specific property at a specific index.
Parameters:
Name
Type
Description
fx
Property
The effect to check
propIndex
int
The index of the property
propName
string
The expected name of the property. Be careful with the internationalization of After Effects...
#static
"cycleIn"(t, nK, o, vAtTimeopt, dampingopt) → {float|Array.<float>}
Animatable equivalent to loopIn('cycle') and loopIn('offset').
Parameters:
Name
Type
Attributes
Default
Description
t
float
The time at which the value must be got. To end the loop, pass the same time for all previous frames.
nK
int
The number of keyframes to loop. Use 0 to loop all keyframes
o
Boolean
Wether to offset or cycle
vAtTime
function
<optional>
valueAtTime
A function to replace valueAtTime. Use this to loop after an expression+keyframe controlled animation, by providing a function used to generate the animation.
#static
"cycleOut"(t, nK, o, vAtTimeopt, dampingopt) → {float|Array.<float>}
Animatable equivalent to loopOut('cycle') and loopOut('offset').
Parameters:
Name
Type
Attributes
Default
Description
t
float
The time at which the value must be got. To end the loop, pass the same time for all subsequent frames.
nK
int
The number of keyframes to loop. Use 0 to loop all keyframes
o
Boolean
Wether to offset or cycle
vAtTime
function
<optional>
valueAtTime
A function to replace valueAtTime. Use this to loop after an expression+keyframe controlled animation, by providing a function used to generate the animation.
Removes the ancestors rotation from the rotation of a layer.
This is very useful to make a layer keep its orientation without being influenced by its parents.
Removes the ancestors scale from the scale of a layer.
This is very useful to make a layer keep its scale without being influenced by its parents.
Note that for performance reasons with expressions, even if the parameters of the function are documented with optional/default values, you MUST provide ALL the arguments when using them.
Interpolates a value with an exponential function.
This method can replace linear() and ease() with a gaussian interpolation.
Note that for performance reasons with expressions, even if the parameters of the function are documented with optional/default values, you MUST provide ALL the arguments when using them.
Converts the point coordinates from the current group in the shape layer to the Layer.
Use toWorld and toComp with the result if you need te coordinates in the world or the comp.
Parameters:
Name
Type
Description
point
Array.<number>
The 2D coordinates of the point in the current group.
Converts the point coordinates from Layer to the current group in the shape layer.
Use fromWorld or fromComp first if you need to convert from the world or composition coordinates, and pass the result to this function.
Interpolates a value with a gaussian function.
This method can replace linear() and ease() with a gaussian interpolation.
Note that for performance reasons with expressions, even if the parameters of the function are documented with optional/default values, you MUST provide ALL the arguments when using them.
Gets the "real" scale of a layer, resulting to its scale property, the scale of its parents, and it's location in Z-space if it's 3D.
Note that for performance reasons with expressions, even if the parameters of the function are documented with optional/default values, you MUST provide ALL the arguments when using them.
Gets the transformation Matrix for the current group in a shape layer, including the transformation from the ancestor groups
Note that for performance reasons with expressions, even if the parameters of the function are documented with optional/default values, you MUST provide ALL the arguments when using them.
Gets the world position of a layer.
Note that for performance reasons with expressions, even if the parameters of the function are documented with optional/default values, you MUST provide ALL the arguments when using them.
Gets the world instant velocity of a layer.
Note that for performance reasons with expressions, even if the parameters of the function are documented with optional/default values, you MUST provide ALL the arguments when using them.
Gets the world orientation of a (2D) layer at a specific time.
Note that for performance reasons with expressions, even if the parameters of the function are documented with optional/default values, you MUST provide ALL the arguments when using them.
Gets the world velocity of a property.
Note that for performance reasons with expressions, even if the parameters of the function are documented with optional/default values, you MUST provide ALL the arguments when using them.
An object with two properties:
- `inside (bool)` is true if the point is inside the polygon
- `closestVertex` is the index of the closest vertex of the polygon
Checks if a property is a transform.position property.
Note that for performance reasons with expressions, even if the parameters of the function are documented with optional/default values, you MUST provide ALL the arguments when using them.
Interpolates a value with a linear function, but also extrapolates it outside of known values.
This method can replace linear(), adding extrapolation.
Note that for performance reasons with expressions, even if the parameters of the function are documented with optional/default values, you MUST provide ALL the arguments when using them.
Interpolates a value with a logarithmic function.
This method can replace linear() and ease() with a gaussian interpolation.
Note that for performance reasons with expressions, even if the parameters of the function are documented with optional/default values, you MUST provide ALL the arguments when using them.
Overshoot animation, to be used when the speed is 0.
Parameters:
Name
Type
Attributes
Default
Description
t
float
The time at which the value must be got. To end the loop, pass the same time for all subsequent frames.
elasticity
float
The elasticity, which controls the amplitude and frequence according to the last known velocity
damping
float
Damping
vAtTime
function
<optional>
valueAtTime
A function to replace valueAtTime. Use this to loop after an expression+keyframe controlled animation, by providing a function used to generate the animation.
The time at which the value must be got. To end the loop, pass the same time for all previous frames.
nK
int
The number of keyframes to loop. Use 0 to loop all keyframes
vAtTime
function
<optional>
valueAtTime
A function to replace valueAtTime. Use this to loop after an expression+keyframe controlled animation, by providing a function used to generate the animation.
Animatable equivalent to loopOut('pingpong').
Note that for performance reasons with expressions, even if the parameters of the function are documented with optional/default values, you MUST provide ALL the arguments when using them.
Parameters:
Name
Type
Attributes
Default
Description
t
float
The time at which the value must be got. To end the loop, pass the same time for all subsequent frames.
nK
int
The number of keyframes to loop. Use 0 to loop all keyframes
vAtTime
function
<optional>
valueAtTime
A function to replace valueAtTime. Use this to loop after an expression+keyframe controlled animation, by providing a function used to generate the animation.
Translates a point with a layer, as if it was parented to it.
Note that for performance reasons with expressions, even if the parameters of the function are documented with optional/default values, you MUST provide ALL the arguments when using them.
Parameters:
Name
Type
Attributes
Default
Description
l
Layer
The layer to get the translation from.
point
Array.<float>
<optional>
[0,0]
The [X,Y] point to translate (using world coordinates).
Generates a "zero" value for the current property, i.e. 0 or [0,0], etc. according to the property type.
Note that for path properties, this method returns a path object with three array attributes: points, inTangents, outTangents.