PropertyBase object

app.project.item(index).layer(index).propertySpec

Description

Properties are accessed by name through layers, using various kinds of expression syntax, as controlled by application preferences. For example, the following are all ways of access properties in the Effects group:
var effect1 = app.project.item(1).layer(1).effect(Add Grain")("Viewing Mode");
var effect1again = app.project.item(1).layer(1).effect.addGrain.viewingMode;
var effect1againtoo = app.project.item(1).layer(1)("Effects").addGrain.viewingMode;
var effect1againtoo2 = app.project.item(1).layer(1)("Effects")("Add Grain")("Viewing Mode");

• PropertyBase is the base class for both Property and PropertyGroup, so PropertyBase attributes and methods are available when working with properties and property groups. See “Property object” and “PropertyGroup object”.
Reference invalidation

When something occurs that changes an object sufficiently for the reference to become invalid, script references to that object can generate errors. In simple cases this is straightforward. For example, if you delete an object, a reference to the deleted object generates the warning “Object is Invalid”:
var layer1 = app.project.item(1).layer(1);
layer1.remove();
alert(layer1.name); // invalid reference to deleted object

Similarly, if you reference an AE property in a deleted object, the warning occurs:
var layer1 = app.project.item(1).layer(1);
var layer1position = layer1.transform.position;
layer1.remove();
alert(layer1position.value); // invalid reference to property in selected object

A less straightforward case is when a property is removed from a property group. In this case, After Effects generates the “Objectis Invalid”error whenyou subsequentlyreferencethat item or other items inthe group, because their index positions have changed. For example:
var effect1 = app.project.item(1).layer(1).effect(1);
var effect2 = app.project.item(1).layer(1).effect(2);
var effect2param = app.project.item(1).layer(1).effect(2).blendWithOriginal;
effect1.remove();
alert(effect2.name); // invalid reference because group index positions have changed

Attributes

Attribute Reference Description
name “PropertyBase name attribute” Name of the property.
matchName “PropertyBase matchName attribute” A special name for the property used to build unique naming paths.
Attribute Reference Description
propertyIndex “PropertyBase propertyIndex attribute” Index of this property within its parent group.
propertyDepth “PropertyBase propertyDepth attribute” The number of levels of parent groups between this property and the containing layer.
propertyType “PropertyBase propertyType attribute” The property type.
parentProperty “PropertyBase parentProperty attribute” The immediate parent group of this property.
isModified “PropertyBase isModified attribute” When true, the property has been changed since its creation.
canSetEnabled “PropertyBase canSetEnabled attribute” When true, the user interface displays an eyeball icon for this property.
enabled “PropertyBase enabled attribute” When true, this property is enabled.
active “PropertyBase active attribute” When true, this property is active.
elided “PropertyBase elided attribute” When true, this property is not displayed in the user interface.
isEffect “PropertyBase isEffect attribute” When true, this property is an effect.
isMask “PropertyBase isMask attribute” When true, this property is a mask.
selected “PropertyBase selected attribute” When true, this property is selected.

Methods

Method Reference Description
propertyGroup() “PropertyBase propertyGroup() method” Gets the parent group for this property.
remove() “PropertyBase remove() method” Removes this from the project.
moveTo() “PropertyBase moveTo() method” Moves this property to a new position in its parent group.
duplicate() “PropertyBase duplicate() method” Duplicates this property object.

Other Tags

Posted in PropertyBase object and tagged , , , , , , , , , , , , , , , , , , .