Property object
app.project.item(index).layer(index).propertySpec
The Property object contains value, keyframe, and expression information about a particular AE property of a layer. An AE property is an value, often animatable, of an effect, mask, or transform within an individual layer. For examples of how to access properties, see “PropertyBase object” on page 148 and “PropertyGroup property() method” on page 157.
- Property is a subclass of PropertyBase. All methods and attributes of PropertyBase, in addition to those listed below, are available when working with Property. See “PropertyBase object” on page 148. NOTE: JavaScript objects commonly referred to as “properties” are called “attributes” in this guide, to avoid confusion with the After Effects definition of property.
Attribute List
| Attribute | Reference | Description |
|---|---|---|
| propertyValueType | “Property propertyValueType attribute” on page 138 | Type of value stored in this property. |
| value | “Property value attribute” on page 146 Current value of the property. hasMin “Property hasMin attribute” on page 130 | When true, there is a minimum permitted value. |
| hasMax | “Property hasMax attribute” on page 130 | When true, there is a maximum permitted value. |
| minValue | “Property minValue attribute” on page 137 | The minimum permitted value. |
| maxValue | “Property maxValue attribute” on page 137 | The maximum permitted value. |
| isSpatial | “Property isSpatial attribute” on page 132 | When true, the property defines a spatial value. |
| canVaryOverTime | “Property canVaryOverTime attribute” on page 129 | When true, the property can be keyframed. |
| isTimeVarying | “Property isTimeVarying attribute” on page 132 | When true, the property has keyframes or an expression enabled that can vary its values. |
| numKeys | “Property numKeys attribute” on page 138 | The number of keyframes on this property. |
| unitsText | “Property unitsText attribute” on page 146 | A text description of the units in which the value is expressed. |
| expression | “Property expression attribute” on page 129 | The expression string for this property. |
| canSetExpression | “Property canSetExpression attribute” on page 128 | When true, the expression can be set by a script. |
| expressionEnabled | “Property expressionEnabled attribute” on page 129 | When true, the expression is used to generate values for the property. |
| expressionError | “Property expressionError attribute” on page 130 | The error, if any, that occurred when the last expression was evaluated. |
| selectedKeys | “Property selectedKeys attribute” on page 140 | All selected keyframes of the property. |
| propertyIndex | “Property propertyIndex attribute” on page 138 | The position index of this property. |
| dimensionsSeparated | “Property dimensionsSeparated attribute” on page 129 | When true, the property’s dimensions are represented as separate properties. |
| isSeparationFollower | “Property isSeparationFollower attribute” on page 131 | When true, the property represents one of the separated dimensions for a multidimensional property. |
| isSeparationLeader | “Property isSeparationLeader attribute” on page 131 | When true, the property is multidimensional and can be separated. |
| separationDimension | “Property separationDimension attribute” on page 140 | For a separated follower, the dimension it represents in the multidimensional leader. |
| separationLeader | “Property separationLeader attribute” on page 140 | The original multidimensional property for this separated follower. |
Methods List
| Method | Reference | Description |
|---|---|---|
| valueAtTime() | “Property valueAtTime() method” on page 146 | Gets the value of the property evaluated at given time. |
| setValue() | “Property setValue() method” on page 144 | Sets the static value of the property. |
| setValueAtTime() | “Property setValueAtTime() method” on page 145 | Creates a keyframe for the property. |
| setValuesAtTimes() | “Property setValuesAtTimes() method” on page 145 | Creates a set of keyframes for the property. |
| setValueAtKey() | “Property setValueAtKey() method” on page 145 | Finds a keyframe and sets the value of the property at that keyframe. |
| nearestKeyIndex() | “Property nearestKeyIndex() method” on page 138 | Gets the keyframe nearest to a specified time. |
| keyTime() | “Property keyTime() method” on page 136 | Gets the time at which a condition occurs. |
| keyValue() | “Property keyValue() method” on page 137 | Gets the value of a keyframe at the time at which a condition occurs. |
| addKey() | “Property addKey() method” on page 128 | Adds a new keyframe to the property at a given time. |
| removeKey() | “Property removeKey() method” on page 139 | Removes a keyframe from the property. |
| isInterpolationTypeValid() | “Property isInterpolationTypeValid() method” on page 131 | When true, this property can be interpolated. |
| setInterpolationTypeAtKey() | “Property setInterpolationTypeAtKey() method” on page 140 | Sets the interpolation type for a key. |
| keyInInterpolationType() | “Property keyInInterpolationType() method” on page 132 | Gets the 'in' interpolation type for a key. |
| keyOutInterpolationType() | “Property keyOutInterpolationType() method” on page 133 | Gets the 'out' interpolation type for a key. |
| setSpatialTangentsAtKey() | “Property setSpatialTangentsAtKey() method” on page 142 | Sets the “in” and “out” tangent vectors for a key. |
| keyInSpatialTangent() | “Property keyInSpatialTangent() method” on page 132 | Gets the “in” spatial tangent for a key. |
| keyOutSpatialTangent() | “Property keyOutSpatialTangent() method” on page 134 | Gets the “out” spatial tangent for a key. |
| setTemporalEaseAtKey() | “Property setTemporalEaseAtKey() method” on page 144 | Sets the “in” and “out” temporal ease for a key. |
| keyInTemporalEase() | “Property keyInTemporalEase() method” on page 133 | Gets the “in” temporal ease for a key. |
| keyOutTemporalEase() | “Property keyOutTemporalEase() method” on page 134Gets | the “out” temporal ease for a key. |
| setTemporalContinuousAtKey() | “Property setTemporalContinuousAtKey() method” on page 143 | Sets whether a keyframe has temporal continuity. |
| keyTemporalContinuous() | “Property keyTemporalContinuous() method” on page 136 | Reports whether a keyframe has temporal continuity. |
| setTemporalAutoBezierAtKey() | “Property setTemporalAutoBezierAtKey() method” on page 143 | Sets whether a keyframe has temporal auto-Bezier. |
| keyTemporalAutoBezier() | “Property keyTemporalAutoBezier() method” on page 136 | Reports whether a keyframe has temporal auto-Bezier. |
| setSpatialContinuousAtKey() | “Property setSpatialContinuousAtKey() method” on page 142 | Sets whether a keyframe has spatial continuity. |
| keySpatialContinuous() | “Property keySpatialContinuous() method” on page 135 | Reports whether a keyframe has spatial continuity. |
| setSpatialAutoBezierAtKey “Property | setSpatialAutoBezierAtKey() method” on page 142 | Sets whether a keyframe has spatial auto-Bezier. |
| keySpatialAutoBezier() | “Property keySpatialAutoBezier() method” on page 135 | Reports whether a keyframe has spatial auto-Bezier. |
| setRovingAtKey() | “Property setRovingAtKey() method” on page 141 | Sets whether a keyframe is roving. |
| keyRoving() | “Property keyRoving() method” on page 134 | Reports whether a keyframe is roving. |
| setSelectedAtKey() | “Property setSelectedAtKey() method” on page 141 | Sets whether a keyframe is selected. |
| keySelected() | “Property keySelected() method” on page 135 | Reports whether a keyframe is selected. |
| getSeparationFollower() | “Property getSeparationFollower() method” on page 130 | For a separated, multidimensional property, retrieves a specific follower property. |
Example:
Get and set the value of opacity
var myProperty = myLayer.opacity;
//opacity has propertyValueType of OneD, and is stored as a float
myProperty.setValue(50); // set opacity to 50%
// Variable myOpacity is a float value
var myOpacity = myProperty.value;
Example:
Get and set the value of a position
var myProperty = myLayer.position;
//position has propertyValueType of ThreeD_SPATIAL, and is stored as an array of 3 floats
myProperty.setValue([10.0, 30.0, 0.0]);
// Variable myPosition is an array of 3 floats
var myPosition = myProperty.value;
Example: Change the value of a mask shape to be open instead of closed
var myMask = mylayer.mask(1);
var myProperty = myMask.maskPath;
myShape = myProperty.value;
myShape.closed = false;
myProperty.setValue(myShape);
Example:
Get the value of a color at a particular time
A color is stored as an array of four floats, [r,g,b,opacity]. This sets the value of the red component of a light's color at time 4 to be half of that at time 2:
var myProperty = myLight.color;
var colorValue = myProperty.valueAtTime(2,true);
colorValue[0] = 0.5 * colorValue[0];
myProperty.setValueAtTime(4,colorValue);
Example: Check that a scale calculated by an expression at time 3.5 is the expected value of [10,50]
var myProperty = myLayer.scale;
// false value of preExpression means evaluate the expression
var scaleValue = myProperty.valueAtTime(3.5,false);
if (scaleValue[0] == 10 && scaleValue[1] == 50) {
alert("hurray");
}
else {
alert("oops");
}
Example:
Keyframe a rotation from 0 to 90 and back again.
The animation is 10 seconds, and the middle keyframe is at the 5 second mark. Rotation properties are stored as a OneD value.
myProperty = myLayer.rotation;
myProperty.setValueAtTime(0, 0);
myProperty.setValueAtTime(5, 90);
myProperty.setValueAtTime(10, 0);
Example: Change the keyframe values for the first three keyframes of some source text
myProperty = myTextLayer.sourceText;
if (myProperty.numKeys < 3) {
alert("error, I thought there were 3 keyframes");
}
else {
myProperty.setValueAtKey(1, new TextDocument("key number 1"));
myProperty.setValueAtKey(2, new TextDocument("key number 2"));
myProperty.setValueAtKey(3, new TextDocument("key number 3"));
}
Example:
Set values using the convenience syntax for position, scale, color, or source text
// These two are equivalent. The second fills in a default of 0.
myLayer.position.setValue([20, 30, 0]);
myLayer.position.setValue([20, 30]);
// These two are equivalent. The second fills in a default of 100.
myLayer.scale.setValue([50, 50, 100]);
myLayer.scale.setValue([50, 50]);
// These two are equivalent. The second fills in a default of 1.0
myLight.color.setValue([.8, .3, .1, 1.0]);
myLight.color.setValue([.8, .3, .1]);
// These two are equivalent. The second creates a TextDocument
myTextLayer.sourceText.setValue(new TextDocument("foo"));
myTextLayer.sourceText.setValue("foo");
addKey() method
app.project.item(index).layer(index).propertySpec.addKey(time)
Adds a new keyframe or marker to the named property at the specified time and returns the index of the new keyframe.
Parameters:
- time The time, in seconds, at which to add the keyframe. A floating-point value. The beginning of the composition is 0.
Returns: Integer the index of the new keyframe or marker.
canSetExpression attribute
app.project.item(index).layer(index).propertySpec.canSetExpression
When true, the named property is of a type whose expression can be set by a script. See also “Property expression attribute” on page 129.
Type: Boolean read-only
canVaryOverTime attribute
app.project.item(index).layer(index).propertySpec.canVaryOverTime
When true, the named property can vary over time—that is, keyframe values or expressions can be written to this property.
Type: Boolean read-only
dimensionsSeparated attribute
app.project.item(index).layer(index).propertySpec.dimensionsSeparated
When true, the property’s dimensions are represented as separate properties. For example, if the layer’s position is represented as X Position and Y Position properties in the Timeline panel, the Position property has this attribute set to true. NOTE: This attribute applies only when the isSeparationLeader attribute is true.
Type: Boolean read/write.
expression attribute
app.project.item(index).layer(index).propertySpec.expression
The expression for the named property. Writeable only when canSetExpression for the named property is true. When you specify a value for this attribute, the string is evaluated.
- If the string contains a valid expression, expressionEnabled becomes true.
- If the string does not contain a valid expression, an error is generated, and expressionEnabled becomes false.
- If you set the attribute to the empty string, expressionEnabled becomes false, but no error is generated.
Type: String read/write if canSetExpression for the named property is true.
expressionEnabled attribute
app.project.item(index).layer(index).propertySpec.expressionEnabled
When true, the named property uses its associated expression to generate a value. When false, the keyframe information or static value of the property is used. This attribute can be set to true only if canSetExpression for the named property is true and expression contains a valid expression string.
Type: Boolean read/write.
expressionError attribute
app.project.item(index).layer(index).propertySpec.expressionError
Contains the error, if any, generated by evaluation of the string most recently set in expression. If no expression string has been specified, or if the last expression string evaluated without error, contains the empty string ("").
Type: String read-only
getSeparationFollower() method
app.project.item(index).layer(index).propertySpec.getSeparationFollower(dim)
For a separated, multidimensional property, retrieves a specific follower property. For example, you can use this method on the Position property to access the separated X Position and Y Position properties. NOTE: This attribute applies only when the isSeparationLeader attribute is true.
Parameters:
- dim The dimension number (starting at 0).
Returns: Property object, or an error if the property is not multidimensional or does not have the specified dimension.
hasMax attribute
app.project.item(index).layer(index).propertySpec.hasMax
When true, there is a maximum permitted value for the named property; otherwise false.
Type: Boolean read-only
hasMin attribute
app.project.item(index).layer(index).propertySpec.hasMin
When true, there is a minimum permitted value for the named property; otherwise false.
Type: Boolean read-only
isInterpolationTypeValid() method
app.project.item(index).layer(index).propertySpec.isInterpolationTypeValid(type)
Returns true if the named property can be interpolated using the specified keyframe interpolation type.
Parameters: type A KeyframeInterpolationType enumerated value; one of:
- KeyframeInterpolationType.LINEAR
- KeyframeInterpolationType.BEZIER
- KeyframeInterpolationType.HOLD
Returns: Boolean
isSeparationFollower attribute
app.project.item(index).layer(index).propertySpec.isSeparationFollower
When true, the property represents one of the separated dimensions for a multidimensional property. For example, the X Position property has this attribute set to true. NOTE: The original, consolidated, multidimensional property is the “separation leader” and the new, separated, single-dimensional properties are its “separation followers”.
Type: Boolean read-only
isSeparationLeader attribute
app.project.item(index).layer(index).propertySpec.isSeparationLeader
When true, the property is multidimensional and can be separated. For example, the Position property has this attribute set to true.
NOTE: The original, consolidated, multidimensional property is the “separation leader” and the new, separated, single-dimensional properties are its “separation followers”.
Type: Boolean read-only
isSpatial attribute
app.project.item(index).layer(index).propertySpec.isSpatial
When true, the named property defines a spatial value. Examples are position and effect point controls.
Type: Boolean read-only
isTimeVarying attribute
app.project.item(index).layer(index).propertySpec.isTimeVarying
When true, the named property is time varying—that is, it has keyframes or an enabled expression. When this attribute is true, the attribute canVaryOverTime must also be true.
Type: Boolean read-only
keyInInterpolationType() method
app.project.item(index).layer(index).propertySpec.keyInInterpolationType(keyIndex)
Returns the 'in' interpolation type for the specified keyframe.
Parameters:
- keyIndex The index for the keyframe. An integer in the range [1..numKeys], as returned by the addKey or nearestKeyIndex method.
Returns: A KeyframeInterpolationType enumerated value; one of:
- KeyframeInterpolationType.LINEAR
- KeyframeInterpolationType.BEZIER
- KeyframeInterpolationType.HOLD
keyInSpatialTangent() method
app.project.item(index).layer(index).propertySpec.keyInSpatialTangent(keyIndex)
Returns the incoming spatial tangent for the specified keyframe, if the named property is spatial (that is, the value type is Tw o D _ SPAT IA L or ThreeD_SPATIAL).
Parameters:
- ** keyIndex** The index for the keyframe. An integer in the range [1..numKeys], as returned by the addKey or nearestKeyIndex method.
Returns: Array of floating-point values:
- If the property value type is PropertyValueType.TwoD_SPATIAL, the array contains 2 floating-point values.
- If the property value type is PropertyValueType.ThreeD_SPATIAL, the array contains 3 floating-point values.
- If the property value type is neither of these types, an exception is generated.
keyInTemporalEase() method
app.project.item(index).layer(index).propertySpec.keyInTemporalEase(keyIndex)
Returns the incoming temporal ease for the specified keyframe.
Parameters:
- keyIndex The index for the keyframe. An integer in the range [1..numKeys], as returned by the addKey or nearestKeyIndex method.
Returns: Array of KeyframeEase objects:
- If the property value type is PropertyValueType.TwoD, the array contains 2 objects.
- If the property value type is PropertyValueType.ThreeD, the array contains 3 objects.
- For any other value type, the array contains 1 object.
keyOutInterpolationType() method
app.project.item(index).layer(index).propertySpec.keyOutInterpolationType(keyIndex)
Returns the outgoing interpolation type for the specified keyframe.
Parameters:
- keyIndex The index for the keyframe. An integer in the range [1..numKeys], as returned by the addKey or nearestKeyIndex method.
Returns: A KeyframeInterpolationType enumerated value; one of:
- KeyframeInterpolationType.LINEAR
- KeyframeInterpolationType.BEZIER
- KeyframeInterpolationType.HOLD
keyOutSpatialTangent() method
app.project.item(index).layer(index).propertySpec.keyOutSpatialTangent(keyIndex)
Returns the outgoing spatial tangent for the specified keyframe.
Parameters:
- keyIndex The index for the keyframe. An integer in the range [1..numKeys], as returned by the addKey or nearestKeyIndex method.
Returns: Array of floating-point values:
- If the property value type is PropertyValueType.TwoD_SPATIAL, the array contains 2 floating-point values.
- If the property value type is PropertyValueType.ThreeD_SPATIAL, the array contains 3 floating-point values.
- If the property value type is neither of these types, an exception is generated.
keyOutTemporalEase() method
app.project.item(index).layer(index).propertySpec.keyOutTemporalEase(keyIndex)
Returns the outgoing temporal ease for the specified keyframe.
Parameters:
- keyIndex The index for the keyframe. An integer in the range [1..numKeys], as returned by the addKey or nearestKeyIndex method.
Returns: Array of KeyframeEase objects:
- If the property value type is PropertyValueType.TwoD, the array contains 2 objects.
- If the property value type is PropertyValueType.ThreeD, the array contains 3 objects.
- For any other value type, the array contains 1 object.
keyRoving() method
app.project.item(index).layer(index).propertySpec.keyRoving(keyIndex)
Returns true if the specified keyframe is roving. The first and last keyframe in a property cannot rove; if you try to set roving for one of these, the operation is ignored, and keyRoving() continues to return false. If the property value type is neither Two D _ SPAT IA L nor ThreeD_SPATIAL, an exception is generated.
Parameters:
- keyIndex The index for the keyframe. An integer in the range [1..numKeys], as returned by the addKey or nearestKeyIndex method.
Returns: Boolean
keySelected() method
app.project.item(index).layer(index).propertySpec.keySelected(keyIndex)
Returns true if the specified keyframe is selected.
Parameters:
- keyIndex The index for the keyframe. An integer in the range [1..numKeys], as returned by the addKey or nearestKeyIndex method.
Returns: Boolean
keySpatialAutoBezier() method
app.project.item(index).layer(index).propertySpec.keySpatialAutoBezier(keyIndex)
Returns true if the specified keyframe has spatial auto-Bezier interpolation. (This type of interpolation affects this keyframe only if keySpatialContinuous(keyIndex) is also true.) If the property value type is neither Two D _ SPAT IA L nor ThreeD_SPATIAL, an exception is generated.
Parameters:
- keyIndex The index for the keyframe. An integer in the range [1..numKeys], as returned by the addKey or nearestKeyIndex method.
Returns: Boolean
keySpatialContinuous() method
app.project.item(index).layer(index).propertySpec.keySpatialContinuous(keyIndex)
Returns true if the specified keyframe has spatial continuity. If the property value type is neither Two D_SPATIAL nor ThreeD_SPATIAL, an exception is generated.
Parameters:
- keyIndex The index for the keyframe. An integer in the range [1..numKeys], as returned by the addKey or nearestKeyIndex method.
Returns: Boolean
keyTemporalAutoBezier() method
app.project.item(index).layer(index).propertySpec.keyTemporalAutoBezier(keyIndex)
Returns true if the specified keyframe has temporal auto-Bezier interpolation. Temporal auto-Bezier interpolation affects this keyframe only if the keyframe interpolation type is Keyfra- meInterpolationType.BEZIER for both keyInInterpolationType(keyIndex) and keyOutInterpola- tionType(keyIndex).
Parameters:
- keyIndex The index for the keyframe. An integer in the range [1..numKeys], as returned by the addKey or nearestKeyIndex method.
Returns: Boolean
keyTemporalContinuous() method
app.project.item(index).layer(index).propertySpec.keyTemporalContinuous(keyIndex)
Returns true if the specified keyframe has temporal continuity. Temporal continuity affects this keyframe only if keyframe interpolation type is KeyframeInterpola- tionType.BEZIER for both keyInInterpolationType(keyIndex) and keyOutInterpolationType(keyIndex).
Parameters:
- keyIndex The index for the keyframe. An integer in the range [1..numKeys], as returned by the addKey or nearestKeyIndex method.
Returns: Boolean
keyTime() method
app.project.item(index).layer(index).propertySpec.keyTime(keyIndex)
app.project.item(index).layer(index).propertySpec.keyTime(markerComment)
Finds the specified keyframe or marker and returns the time at which it occurs.
If no keyframe or marker can be found that matches the argument, this method generates an exception, and an error is displayed.
Parameters:
- keyIndex The index for the keyframe. An integer in the range [1..numKeys], as returned by the addKey or nearestKeyIndex method.
- markerComment The comment string attached to a marker (see “MarkerValue comment attribute” on page 103).
Returns: Floating-point value
keyValue() method
app.project.item(index).layer(index).propertySpec.keyValue(keyIndex)
app.project.item(index).layer(index).propertySpec.keyValue(markerComment)
Finds the specified keyframe or marker and returns its current value. If no keyframe or marker can be found that matches the argument, this method generates an exception, and an error is displayed.
Parameters:
- keyIndex The index for the keyframe. An integer in the range [1..numKeys], as returned by the addKey or nearestKeyIndex method.
- markerComment The comment string attached to a marker (see “MarkerValue comment attribute” on page 103).
Returns: Floating-point value for keyframes, MarkerValue object for markers.
maxValue attribute
app.project.item(index).layer(index).propertySpec.maxValue
The maximum permitted value of the named property. If the hasMax attribute is false, an exception occurs, and an error is generated.
Type: Floating-point value read-only
minValue attribute
app.project.item(index).layer(index).propertySpec.minValue
The minimum permitted value of the named property. If the hasMin attribute is false, an exception occurs, and an error is generated.
Type: Floating-point value read-only
nearestKeyIndex() method
app.project.item(index).layer(index).propertySpec.nearestKeyIndex(time)
Returns the index of the keyframe nearest to the specified time.
Parameters:
Returns: Integer
numKeys attribute
app.project.item(index).layer(index).propertySpec.numKeys
The number of keyframes in the named property. If the value is 0, the property is not being keyframed.
Type: Integer read-only
propertyIndex attribute
app.project.item(index).layer(index).propertySpec.propertyIndex
The position index of the named property. The first property is at index position 1.
Type: Integer read-only
propertyValueType attribute
app.project.item(index).layer(index).propertySpec.propertyValueType
The type of value stored in the named property. The PropertyValueType enumeration has one value for each type of data that can be stored in or retrieved from a property. Each type of data is stored and retrieved in a different kind of structure. All property objects store data according to one of these categories. For example, a 3D spatial property (such as a layer's position) is stored as an array of three floating point values.
When setting a value for position, pass in such an array, as follows:
mylayer.property("position").setValue([10,20,0]);
time The time in seconds; a floating-point value. The beginning of the composition is 0.
In contrast, a shape property (such as a layer's mask shape) is stored as a Shape object. When setting a value for a shape, pass a Shape object, as follows:
var myShape = new Shape();
myShape.vertices = [[0,0],[0,100],[100,100],[100,0]];
var myMask = mylayer.property("ADBE Mask Parade").property(1);
myMask.property("ADBE Mask Shape").setValue(myShape);
Type: A PropertyValueType enumerated value; read/write. One of:
- PropertyValueType.NO_VALUE Stores no data.
- PropertyValueType.ThreeD_SPATIAL Array of three floating-point positional values. For example, an Anchor Point value might be [10.0, 20.2, 0.0]
- PropertyValueType.ThreeD Array of three floating-point quantitative values. For example, a Scale value might be [100.0, 20.2, 0.0]
- PropertyValueType.TwoD_SPATIAL Array of 2 floating-point positional values For example, an Anchor Point value might be [5.1, 10.0]
- PropertyValueType.TwoD Array of 2 floating-point quantitative values. For example, a Scale value might be [5.1, 100.0]
- PropertyValueType.OneD A floating-point value.
- PropertyValueType.COLOR Array of 4 floating-point values in the range [0.0..1.0]. For example, [0.8,0.3, 0.1, 1.0]
- PropertyValueType.CUSTOM_VALUE Custom property value, such as the Histogram property for the Levels effect.
- PropertyValueType.MARKER MarkerValue object; see “MarkerValue object” on page 102.
- PropertyValueType.LAYER_INDEX Integer; a value of 0 means no layer.
- PropertyValueType.MASK_INDEX Integer; a value of 0 means no mask.
- PropertyValueType.SHAPE Shape object; see “Shape object” on page 172.
- PropertyValueType.TEXT_DOCUMENT TextDocument object; see “TextDocument object” on page 182.
removeKey() method
app.project.item(index).layer(index).propertySpec.removeKey(keyIndex)
Removes the specified keyframe from the named property. If no keyframe with the specified index exists, generates an exception and displays an error. When a keyframe is removed, the remaining index numbers change. To remove more than one keyframe, you must start with the highest index number and work down to the lowest to ensure that the remaining indices reference the same keyframe after each removal.
Parameters:
- keyIndex The index for the keyframe. An integer in the range [1..numKeys], as returned by the addKey or nearestKeyIndex method.
Returns: Nothing.
selectedKeys attribute
app.project.item(index).layer(index).propertySpec.selectedKeys
The indices of all the selected keyframes in the named property. If no keyframes are selected, or if the property has no keyframes, returns an empty array.
Type: Array of integers read-only
separationDimension attribute
app.project.item(index).layer(index).propertySpec.separationDimension
For a separated follower, the dimension number it represents in the multidimensional leader. The first dimension starts at 0. For example, the Y Position property has a separationDimension value of 1; X Position has a value of 0.
Type: Integer read-only
separationLeader attribute
app.project.item(index).layer(index).propertySpec.separationLeader
The original multidimensional property for this separated follower. For example, if the current property is Y Position, this attribute’s value points to the Position property. NOTE: The original, consolidated, multidimensional property is the “separation leader” and the new, separated, single-dimensional properties are its “separation followers”.
Type: Property object read-only
setInterpolationTypeAtKey() method
app.project.item(index).layer(index).propertySpec.setInterpolationTypeAtKey(keyIndex, inType, outType)
Sets the ‘in’ and ‘out’ interpolation types for the specified keyframe.
Parameters:
- keyIndex The index for the keyframe. An integer in the range [1..numKeys], as returned by the addKey or nearestKeyIndex method.
-
inType The incoming interpolation type. A KeyframeInterpolationType enumerated value; one of:
- KeyframeInterpolationType.LINEAR
- KeyframeInterpolationType.BEZIER
- KeyframeInterpolationType.HOLD
-
outType Optional The outgoing interpolation type. If not supplied, the ‘out’ type is set to the inType value. A KeyframeInterpolationType enumerated value; one of:
- KeyframeInterpolationType.LINEAR
- KeyframeInterpolationType.BEZIER
- KeyframeInterpolationType.HOLD
Returns: Nothing.
setRovingAtKey() method
app.project.item(index).layer(index).propertySpec.setRovingAtKey(keyIndex, newVal)
Turns roving on or off for the specified keyframe. The first and last keyframe in a property cannot rove; if you try to set roving for one of these, the operation is ignored, and keyRoving() continues to return false. If the property value type is neither Two D _ SPAT IA L nor ThreeD_SPATIAL, an exception is generated.
Parameters:
- keyIndex The index for the keyframe. An integer in the range [1..numKeys], as returned by the addKey or nearestKeyIndex method.
- newVal True to turn roving on, false to turn roving off.
Returns: Nothing.
setSelectedAtKey() method
app.project.item(index).layer(index).propertySpec.setSelectedAtKey(keyIndex, onOff)
Selects or deselects the specified keyframe.
Parameters:
- keyIndex The index for the keyframe. An integer in the range [1..numKeys], as returned by the addKey or nearestKeyIndex method.
- onOff True to select the keyframe, false to deselect it.
Returns: Nothing.
setSpatialAutoBezierAtKey() method
app.project.item(index).layer(index).propertySpec.setSpatialAutoBezierAtKey(keyIndex, newVal)
Turns spatial auto-Bezier interpolation on or off for the specified keyframe. If the property value type is neither Two D _ SPAT IA L nor ThreeD_SPATIAL, an exception is generated.
Parameters:
- keyIndex The index for the keyframe. An integer in the range [1..numKeys], as returned by the addKey or nearestKeyIndex method.
- newVal True to turn spatial auto-Bezier on, false to turn it off.
Returns: Nothing.
setSpatialContinuousAtKey() method
app.project.item(index).layer(index).propertySpec.setSpatialContinuousAtKey(keyIndex, newVal)
Turns spatial continuity on or off for the specified keyframe.
If the property value type is neither Two D _ SPAT IA L nor ThreeD_SPATIAL, an exception is generated.
Parameters:
- keyIndex The index for the keyframe. An integer in the range [1..numKeys], as returned by the addKey or nearestKeyIndex method.
- newVal True to turn spatial continuity on, false to turn it off.
Returns: Nothing.
setSpatialTangentsAtKey() method
app.project.item(index).layer(index).propertySpec.setSpatialTangentsAtKey(keyIndex, inTangent, outTangent)
Sets the incoming and outgoing tangent vectors for the specified keyframe.
If the property value type is neither Two D _ SPAT IA L nor ThreeD_SPATIAL, an exception is generated.
Parameters:
- keyIndex The index for the keyframe. An integer in the range [1..numKeys], as returned by the addKey or nearestKeyIndex method.
- inTangent The incoming tangent vector. An array of 2 or 3 floating-point values.
- If the property value type is PropertyValueType.TwoD_SPATIAL, the array contains 2 values.
- If the property value type is PropertyValueType.ThreeD_SPATIAL, the array contains 3 values.
- outTangent (Optional) The outgoing tangent vector. If not supplied, the ‘out’ tangent is set to the inTangent value. An array of 2 or 3 floating-point values.
- If the property value type is PropertyValueType.TwoD_SPATIAL, the array contains 2 values.
- If the property value type is PropertyValueType.ThreeD_SPATIAL, the array contains 3 values.
Returns: Nothing.
setTemporalAutoBezierAtKey() method
app.project.item(index).layer(index).propertySpec.setTemporalAutoBezierAtKey(keyIndex, newVal)
Turns temporal auto-Bezier interpolation on or off for the specified keyframe. When this is turned on, it
affects this keyframe only if keySpatialContinuous(keyIndex) is also true.
Parameters:
- keyIndex The index for the keyframe. An integer in the range [1..numKeys], as returned by the addKey or nearestKeyIndex method.
- newVal True to turn temporal auto-Bezier on, false to turn it off.
Returns: Nothing.
setTemporalContinuousAtKey() method
app.project.item(index).layer(index).propertySpec.setTemporalContinuousAtKey(keyIndex, newVal)
Turns temporal continuity on or off for the specified keyframe.
When temporal continuity is turned on, it affects this keyframe only if the keyframe interpolation type is
KeyframeInterpolationType.BEZIER for both keyInInterpolationType(keyIndex) and keyOutInterpola-
tionType(keyIndex).
Parameters:
- keyIndex The index for the keyframe. An integer in the range [1..numKeys], as returned by the addKey or nearestKeyIndex method.
- newVal True to turn temporal continuity on, false to turn it off.
Returns: Nothing.
setTemporalEaseAtKey() method
app.project.item(index).layer(index).propertySpec.setTemporalEaseAtKey(keyIndex, inTemporalEase, outTemporalEase)
Sets the incoming and outgoing temporal ease for the specified keyframe. See “KeyframeEase object” on page 84.
Parameters:
- keyIndex The index for the keyframe. An integer in the range [1..numKeys], as returned by the addKey or nearestKeyIndex method.
- inTemporalEase The incoming temporal ease. An array of 1, 2, or 3 KeyframeEase objects.
- If the property value type is PropertyValueType.TwoD, the array contains 2 objects.
- If the property value type is PropertyValueType.ThreeD, the array contains 3 objects.
- For all other value types, the array contains 1 object.
- outTemporalEase (Optional) The outgoing temporal ease. If not supplied, the outgoing ease is set to the inTemporalEase value. An array of 1, 2, or 3 KeyframeEase objects.
- If the property value type is PropertyValueType.TwoD, the array contains 2 objects.
- If the property value type is PropertyValueType.ThreeD, the array contains 3 objects.
- For all other value types, the array contains 1 object.
Returns: Nothing.
setValue() method
app.project.item(index).layer(index).propertySpec.setValue(newValue)
Sets the static value of a property that has no keyframes. If the named property has keyframes, this method generates an exception and displays an error. To set the value of a property with keyframes, use “Property setValueAtTime() method” on page 145 or “Property setValueAtKey() method” on page 145.
Parameters:
- newValue A value appropriate for the type of property being set; see “Property propertyValueType attribute” on page 138.
Returns: Nothing.
setValueAtKey() method
app.project.item(index).layer(index).propertySpec.setValueAtKey(keyIndex, newValue)
Finds the specified keyframe and sets its value. If the named property has no keyframes, or no keyframe with the specified index, this method generates an exception and displays an error.
Parameters:
- keyIndex The index for the keyframe. An integer in the range [1..numKeys], as returned by the addKey or nearestKeyIndex method.
- newValue A value appropriate for the type of property being set; see “Property propertyValueType attribute” on page 138.
Returns: Nothing.
setValueAtTime() method
app.project.item(index).layer(index).propertySpec.setValueAtTime(time, newValue)
Sets the value of a keyframe at the specified time. Creates a new keyframe for the named property, if one does
not currently exist for the specified time, and sets its value.
Parameters:
- time The time in seconds, a floating-point value. The beginning of the composition is 0.
- newValue A value appropriate for the type of property being set; see “Property propertyValueType attribute” on page 138.
Returns: Nothing.
setValuesAtTimes() method
app.project.item(index).layer(index).propertySpec.setValuesAtTimes(times, newValues)
Sets values for a set of keyframes at specified of times. Creates a new keyframe for the named property, if one does not currently exist for a specified time, and sets its value. Times and values are expressed as arrays; the arrays must be of the same length.
Parameters:
- times An array of times, in seconds. Each time is a floating-point value. The beginning of the composition is 0.
- newValues A array of values appropriate for the type of property being set; see “Property propertyValueType attribute” on page 138.
Returns: Nothing.
unitsText attribute
app.project.item(index).layer(index).propertySpec.unitsText
The text description of the units in which the value is expressed.
Type: String read-only
value attribute
app.project.item(index).layer(index).propertySpec.value
The value of the named property at the current time.
- If expressionEnabled is true, returns the evaluated expression value.
- If there are keyframes, returns the keyframed value at the current time.
- Otherwise, returns the static value.
The type of value returned depends on the property value type. See examples for “Property object” on page 124.
Type: A value appropriate for the type of the property (see “Property propertyValueType attribute” on page 138) read-only
valueAtTime() method
app.project.item(index).layer(index).propertySpec.valueAtTime(time, preExpression)
The value of the named property as evaluated at the specified time. Note that the type of value returned is not made explicit; it will be of a different type, depending on the property evaluated.
Parameters:
- time The time in seconds; a floating-point value. The beginning of the composition is 0.
- preExpression If the property has an expression and this is true, return the value for the specified time without applying the expression to it. When false, return the result of evaluating the expression for the specified time. Ignored if the property does not have an associated expression.
Returns: A value appropriate for the type of the property (see “Property propertyValueType attribute” on page 138).