Property group
PropertyGroup
¶
Bases: PropertyBase
The PropertyGroup object represents a group of properties. It can contain
Property objects and other PropertyGroup objects. Property groups can
be nested to provide a parent-child hierarchy, with a Layer object at the
top (root) down to a single Property object, such as the mask feather of
the third mask. To traverse the group hierarchy, use PropertyBase methods
and attributes; see PropertyBase.propertyGroup(). For examples of how to
access properties and property groups, see PropertyBase object.
Example
Info
PropertyGroup is a subclass of PropertyBase. All methods and
attributes of PropertyBase are available when working with
PropertyGroup.
Info
PropertyGroup is a base class for Layer and MaskPropertyGroup.
PropertyGroup attributes and methods are available when working with
layer or mask groups.
See: https://ae-scripting.docsforadobe.dev/property/propertygroup/
Attributes¶
can_set_enabled
¶
can_set_enabled: bool
True if the enabled attribute value can be set.
This is True for all layers, effect property groups, shape
vector groups, and text path options. Read-only.
elided
¶
elided: bool
When True, the property is not shown in the UI. An elided
property is still present in the timeline but hidden from view.
Read-only.
enabled
¶
enabled = ChunkField[bool](
"_tdsb",
"enabled",
default=True,
validate=_validate_enabled,
)
Corresponds to the setting of the eyeball icon. Read / Write.
is_modified
¶
is_modified: bool
True if any child property is modified.
For indexed groups (such as Effects or Masks parades), the group is considered modified when it has any children - adding items to an indexed group is itself a modification. Shape vector groups (value) follow the same rule.
match_name
¶
match_name: str
A special name for the property used to build unique naming paths. The match name is not displayed, but you can refer to it in scripts. Every property has a unique match-name identifier. Read-only.
num_properties
¶
num_properties: int
The number of child properties in this group.
Equivalent to ExtendScript PropertyGroup.numProperties.
parent_property
¶
parent_property: PropertyGroup | None
The parent PropertyGroup of this property, or None for
top-level layer property groups. Read-only.
properties
¶
properties: list[Property | PropertyGroup]
List of properties in this group. Read-only.
property_depth
¶
property_depth: int
The number of levels of parent groups between this property and the containing layer. The value is 0 for a layer. Read-only.
property_index
¶
property_index: int | None
The 0-based position of this property within its parent group.
Returns None for layers (property depth 0).
Warning
Unlike ExtendScript (1-based), this uses Python's 0-based
convention so that group.properties[prop.property_index]
works directly.
Read-only.
property_type
¶
property_type: PropertyType
The type of this property. One of PropertyType.PROPERTY,
PropertyType.NAMED_GROUP, or PropertyType.INDEXED_GROUP.
Read-only.
selected
¶
selected: bool
When True, the property is selected. Read / Write.
Note
Property selection is stored in the .aep binary format but very complex.
Parsed projects report False for now.
Functions¶
can_add_property
¶
Check whether a property with the given name can be added.
Returns True if this group is an indexed group and name is
a valid match name or display name for the group type. For
the Effect Parade, any non-empty string is accepted (actual
effect availability is validated at add time).
Parameters:
-
name(str) –A match name or display name to check.
duplicate
¶
duplicate() -> PropertyBase
Duplicate this property within its parent group.
The duplicate is inserted immediately after the original. Only valid for children of indexed groups (see PropertyType).
Returns:
-
PropertyBase–The newly created PropertyBase.
Raises:
-
ValueError–If this property is not in an indexed group.
move_to
¶
move_to(new_index: int) -> None
Move this property to a new 0-based index within its parent group.
Only valid for children of indexed groups.
Parameters:
-
new_index(int) –The target 0-based position.
Raises:
-
ValueError–If this property is not in an indexed group.
-
IndexError–If
new_indexis out of range.
property
¶
property(key: int | str) -> Property | PropertyGroup
remove
¶
Remove this property from its parent group.
Only valid for children of indexed groups (effects, masks, shape contents, text animators).
Raises:
-
ValueError–If this property is not in an indexed group.