Get some handy informations about a property
This class is able to "fix" effects properties which have been broken by
the addition of another effect on the same layer, as long as the class has been
instanciated before the effect has been broken.
Some methods in this class (but not all) are recursive: they can be run even if the property is a group containing other properties.
The property. If a DuAEProperty is provided, the constructor returns it (it does not make a copy).
This makes it easy to avoid type checking, as you can always pass any property or DuAEProperty to the constructor to be sure to handle a DuAEProperty, without any impact on performance.
var propInfo = new DuAEProperty(property);
layer("ADBE effect parade").addProperty("ADBE layer control"); //now the property object is broken
property = propInfo.getProperty(); // You can retrieve the property like this, fixed if it's an effect
myFunction (prop) //This function can be passed either a property or a DuAEProperty
{
propInfo = new DuAEProperty(prop);
prop = propInfo.getProperty();
}
PropertyType
|
PropertyValueType
|
string
|
function
<optional>
A filter to get only a certain type, or value type, or property name or matchName.
A function which take one PropertyBase as argument can be used to filter the properties: the Property will be returned if the function returns true.
strict
boolean
<optional>
false
If a string filter is provided, whether to search for the exact name/matchName or if it contains the filter.
caseSensitive
boolean
<optional>
true
If a string filter is provided, and not strict is false, does the search have to be case sensitive?
Checks if the property contains a Bézier "path" property (it's a mask path or a shape layer path).
The function can be used as a filter for DuAELayer.getSelectedProps.
Recursive: this method can run on a property group.
Recursilvely adds all the (supported) properties found to the essential graphics panel
Note: any Property or PropertyGroup (and its subproperties) named "data" will be ignored.
Recursive: this method can run on a property group.
Recursilvely gets all animations in the property and subproperties in the whole timeline or in the time range
The first DuAEKeyframe._time will be adjusted relatively to the start of the time range (if provided) instead of the startTime of the composition.
Parameters:
Name
Type
Attributes
Default
Description
selected
boolean
<optional>
false
true to get only selected keyframes.
timeRange
Array.<float>
<optional>
The time range, an array of two time values, in seconds. If not provided, will use the comp time range.
By default, checks one value per keyframe. A lower value increases the precision and allows for sub-frame sampling. A higher value is faster but less precise.
frameStep
float
<optional>
1.0
By default, checks one value per keyframe. A lower value increases the precision and allows for sub-frame sampling. A higher value is faster but less precise.
Recursive: this method can run on a property group.
Gets the After Effects animated (with keyframes) properties in the propertyGroup
Parameters:
Name
Type
Attributes
Default
Description
filter
PropertyType
|
PropertyValueType
|
string
|
function
<optional>
A filter to get only a certain type, or value type, or property name or matchName.
A function which take one PropertyBase as argument can be used to filter the properties: the Property will be returned if the function returns true.
strict
boolean
<optional>
false
If a string filter is provided, whether to search for the exact name/matchName or if it contains the filter.
caseSensitive
boolean
<optional>
true
If a string filter is provided, and not strict is false, does the search have to be case sensitive?
The index of the key to retrieve. If the index is negative, it is counted from the end i.e. to retrieve the keyframe before the last one, use -2 (-1 is the last)
Gets the property keyframes in the whole timeline or in the time range
The DuAEKeyframe._time will be adjusted relatively to the start of the time range instead of the startTime of the composition.
Parameters:
Name
Type
Attributes
Default
Description
selected
boolean
<optional>
false
true to get only selected keyframes.
timeRange
Array.<float>
<optional>
The time range, an array of two time values, in seconds. If not provided, will use the comp time range.
Ignored if selected is true;
Recursive: this method can run on a property group.
Link all the properties found in this prop to all the same properties of parentProp (this is a recursive method)
Note: any Property or PropertyGroup (and its subproperties) named "Data" will be linked the opposite way (from parentProp to childProp).
Whether to begin the expression by 'thisComp' or 'comp("name")', default: will detect if the properties are in the same comp
timeLayer
LayerItem
<optional>
null
A layer used to offset the time (typically, in case of link between precompositions, the precomposition layer).
When not null, the start time of this layer will be taken into account to get the values and synchronize them.
Gets the maximum speed of the animated property.
The property type must be one of: one D, two D, three D (spatial or not), Color.
If the property is not one of these types, returns 0.
Parameters:
Name
Type
Attributes
Default
Description
preExpression
bool
<optional>
true
True to get the velocity from keyframes instead of the result of the exression
fastMode
bool
<optional>
true
True to limit the number of samples used to compute the velocity and make the process faster.
The number of samples is automatically adapted from the duration of the composition.
When true and if there are more than one keyframe, the velocity is sampled only between keyframes.
Gets the maximum velocity of the animated property ofr a given axis.
The property type must be one of: one D, two D, three D (spatial or not), Color.
If the property is not one of these types, returns 0.
Parameters:
Name
Type
Attributes
Default
Description
axis
int
The axis
preExpression
bool
<optional>
true
True to get the velocity from keyframes instead of the result of the exression
fastMode
bool
<optional>
true
True to limit the number of samples used to compute the velocity and make the process faster.
The number of samples is automatically adapted from the duration of the composition.
When true and if there are more than one keyframe, the velocity is sampled only between keyframes.
Gets the minimum velocity of the animated property ofr a given axis.
The property type must be one of: one D, two D, three D (spatial or not), Color.
If the property is not one of these types, returns 0.
Parameters:
Name
Type
Attributes
Default
Description
axis
int
The axis
preExpression
bool
<optional>
true
True to get the velocity from keyframes instead of the result of the exression
fastMode
bool
<optional>
true
True to limit the number of samples used to compute the velocity and make the process faster.
The number of samples is automatically adapted from the duration of the composition.
When true and if there are more than one keyframe, the velocity is sampled only between keyframes.
Reimplements the PropertyGroup.numProperties attribute.
Use this to be sure to get the right number of props, in case some have been added or removed after the creation of the DuAEProperty object.
Gets the value range of the animated property.
The property type must be one of: one D, two D, three D (spatial or not), Color.
If the property is not one of these types, returns an empty Array.
Parameters:
Name
Type
Attributes
Default
Description
axis
int
<optional>
0
The axis (or the color channel) to get the range
preExpression
bool
<optional>
true
True to get the range from keyframes instead of the result of the exression
fastMode
bool
<optional>
true
True to check the range with values only at keyframe times. False to check the range with all values, at each frame of the comp.
Sets the property animation on the property. This is a lower-level method than DuAEProperty.setAnimation().
Use this method only to force the animation onto the property without checks.
Must be used on a Property (not a group) with a DuAEPropertyAnimation (not a DuAEPropertyGroupAnimation).
To easily set an animation on a property with automatic compatibility checks, you should use setAnimation().
true to set the anim even if name of the property do not match the animation.
setExpression
boolean
<optional>
false
Sets the expression too
onlyKeyframes
boolean
<optional>
true
If false, the value of properties without keyframes will be set too.
replace
boolean
<optional>
false
true to remove any existing keyframe on the properties before adding new keyframes
whiteList
Array.<string>
<optional>
A list of matchNames used as a white list for properties to set anims.
Can be the matchName of a propertyGroup to set all the subproperties.
Ignored if the list is empty.
offset
boolean
<optional>
false
true to offset the current value, instead of replacing it
offsetTransform
Boolean
<optional>
false
When set to true, the transform (position, rotation) values will be offset to 0 before applying the animation.
The in interpolation ease value. Will be ignored if undefined.
easeOutValue
Array.<int>
|
int
<optional>
The out interpolation ease value. Will be ignored if undefined.
velocityInValue
Array.<int>
|
int
<optional>
The out interpolation ease value. Will be ignored if undefined.
velocityOutValue
Array.<int>
|
int
<optional>
The out interpolation ease value. Will be ignored if undefined.
velocityAsPercent
boolean
<optional>
false
Use a percent instead of a value to set velocities.
In this case, the proper velocity value will be deduced by multiplying the max speed of the property by the percent.
Reimplements the Property.setPropertyParameters() method.
Works around issues caused by the AE API:
- The property object is invalidated (-> fix: use of DuAEProperty.getProperty)
- The effect loses its name (-> fix: name is reset afterwards)
- Names are not sanitized and may throw errors (-> fix: names are sanitized so no errors are thrown)
- Throws an error on AE < 17.0.1 (-> fix: just do nothing in this case)
This method can be called either from the actual Property or its containing effect.
Recursive: this method can run on a property group.
Uses a smarter algorithm to bake the expression to keyframes
Parameters:
Name
Type
Attributes
Default
Description
frameStep
float
<optional>
1.0
By default, checks one value per keyframe. A lower value increases the precision and allows for sub-frame sampling. A higher value is faster but less precise.