Composition
CompItem
¶
CompItem(
comment: str,
id: int,
label: Label,
name: str,
parent_folder: FolderItem | None,
type_name: str,
duration: float,
frame_duration: int,
frame_rate: float,
height: int,
pixel_aspect: float,
width: int,
bg_color: list[float],
display_start_frame: int,
draft3d: bool,
drop_frame: bool,
display_start_time: float,
frame_blending: bool,
hide_shy_layers: bool,
layers: list[Layer],
marker_property: Property | None,
motion_blur: bool,
motion_blur_adaptive_sample_limit: int,
motion_blur_samples_per_frame: int,
preserve_nested_frame_rate: bool,
preserve_nested_resolution: bool,
shutter_angle: int,
shutter_phase: int,
resolution_factor: list[int],
time_scale: float,
in_point: float,
frame_in_point: int,
out_point: float,
frame_out_point: int,
frame_time: int,
time: float,
)
Bases: AVItem
The CompItem object represents a composition, and allows you to
manipulate and get information about it.
Example
Info
Item is the base class for AVItem object and for FolderItem object, which are in turn the base classes for various other item types, so Item attributes and methods are available when working with all of these item types.
See: https://ae-scripting.docsforadobe.dev/item/compitem/
Attributes¶
active_camera
¶
active_camera: CameraLayer | None
The front-most enabled camera layer, or None.
Returns the first CameraLayer that is active at the current
composition time. The value is None when the composition
contains no active camera layers.
adjustment_layers
¶
A list of the adjustment layers in this composition.
bg_color
¶
The background color of the composition. The three array values specify the red, green, and blue components of the color.
composition_layers
¶
A list of the composition layers whose source are compositions.
display_start_time
¶
display_start_time: float
The time set as the beginning of the composition, in seconds. This is the equivalent of the Start Timecode or Start Frame setting in the Composition Settings dialog box.
draft3d
¶
draft3d: bool
When True, Draft 3D mode is enabled for the composition. This
improves preview speed by disabling certain 3D rendering features.
Warning
Deprecated in After Effects 2024 in favor of the new Draft 3D mode.
drop_frame
¶
drop_frame: bool
When True, timecode is displayed in drop-frame format. Only applicable
when frameRate is 29.97 or 59.94.
duration
¶
duration: float
The duration of the item in seconds. Still footages have a duration of 0.
footage_layers
¶
A list of the composition layers whose source are footages.
footage_missing
¶
When True, the AVItem is a placeholder, or represents footage with a
source file that could not be found when the project was last saved.
In this case, the path of the missing source file is in the
missing_footage_path attribute of the footage item's source-file object.
See FootageItem.main_source and
FileSource.missing_footage_path.
frame_blending
¶
frame_blending: bool
When True, frame blending is enabled for this Composition. Corresponds to
the value of the Frame Blending button in the Composition panel.
frame_duration
¶
frame_duration: int
The duration of the item in frames. Still footages have a duration of 0.
has_video
¶
has_video: bool
True if the item has a video component.
An AVItem has video when it has non-zero dimensions (width > 0
and height > 0). In a CompItem, the value is always True.
In a FootageItem,
the value depends on the footage source (e.g. audio-only files
return False).
hide_shy_layers
¶
hide_shy_layers: bool
When True, only layers with shy set to False are shown in the
Timeline panel. When False, all layers are visible, including those whose
shy value is True. Corresponds to the value of the Hide All Shy Layers
button in the Composition panel.
label
¶
label: Label
The label color. Colors are represented by their number (0 for None, or 1 to 16 for one of the preset colors in the Labels preferences).
marker_property
¶
marker_property: Property | None
The composition's marker property.
A Property with
match_name="ADBE Marker" whose keyframes hold marker values.
None when the composition has no markers.
markers
¶
markers: list[MarkerValue]
A flat list of MarkerValue objects for this composition.
Shortcut for accessing marker data without navigating the property tree. Returns an empty list when the composition has no markers.
motion_blur
¶
motion_blur: bool
When True, motion blur is enabled for the composition. Corresponds to
the value of the Motion Blur button in the Composition panel.
motion_blur_adaptive_sample_limit
¶
motion_blur_adaptive_sample_limit: int
The maximum number of motion blur samples of 2D layer motion. This corresponds to the Adaptive Sample Limit setting in the Advanced tab of the Composition Settings dialog box.
motion_blur_samples_per_frame
¶
motion_blur_samples_per_frame: int
The minimum number of motion blur samples per frame for Classic 3D layers, shape layers, and certain effects. This corresponds to the Samples Per Frame setting in the Advanced tab of the Composition Settings dialog box.
parent_folder
¶
parent_folder: FolderItem | None = field(repr=False)
The parent folder of this item. None for the root folder.
placeholder_layers
¶
A list of the layers whose source are placeholders.
preserve_nested_frame_rate
¶
preserve_nested_frame_rate: bool
When True, the frame rate of nested compositions is preserved in the
current composition. Corresponds to the value of the "Preserve frame rate
when nested or in render queue" option in the Advanced tab of the
Composition Settings dialog box.
preserve_nested_resolution
¶
preserve_nested_resolution: bool
When True, the resolution of nested compositions is preserved in the
current composition. Corresponds to the value of the "Preserve Resolution
When Nested" option in the Advanced tab of the Composition Settings dialog
box.
resolution_factor
¶
The x and y downsample resolution factors for rendering the composition. The two values in the array specify how many pixels to skip when sampling; the first number controls horizontal sampling, the second controls vertical sampling. Full resolution is [1, 1], half resolution is [2, 2], and quarter resolution is [4, 4]. The default is [1, 1].
shutter_angle
¶
shutter_angle: int
The shutter angle setting for the composition. This corresponds to the Shutter Angle setting in the Advanced tab of the Composition Settings dialog box.
shutter_phase
¶
shutter_phase: int
The shutter phase setting for the composition. This corresponds to the Shutter Phase setting in the Advanced tab of the Composition Settings dialog box.
three_d_model_layers
¶
three_d_model_layers: list[ThreeDModelLayer]
A list of the 3D model layers in this composition.
time_scale
¶
time_scale: float
The time scale, used as a divisor for keyframe time values. For integer frame rates (e.g. 24fps) this is a whole number. For non-integer frame rates (e.g. 29.97fps) this includes a fractional part (e.g. 3.125).
type_name
¶
type_name: str
A user-readable name for the item type ("Folder", "Footage" or "Composition"). These names are application locale-dependent, meaning that they are different depending on the application's UI language.
work_area_start_frame
¶
work_area_start_frame: int
The work area start frame relative to composition start.
Functions¶
layer
¶
layer(
name: str | None = None,
index: int | None = None,
other_layer: Layer | None = None,
rel_index: int | None = None,
) -> Layer
Get a Layer object by name, index, or relative to another layer.
Parameters:
-
(name¶str | None, default:None) –The name of the layer to return.
-
(index¶int | None, default:None) –The index position of the layer to return.
-
(other_layer¶Layer | None, default:None) –A Layer object to use as a reference for the relative index position of the layer to return.
-
(rel_index¶int | None, default:None) –The index position of the layer relative to the other_layer to return.