Skip to content

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],
    markers: list[MarkerValue],
    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.

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

bg_color

bg_color: list[float]

The background color of the composition. The three array values specify the red, green, and blue components of the color.

comment

comment: str

The item comment.

composition_layers

composition_layers: list[AVLayer]

A list of the composition layers whose source are compositions.

display_start_frame

display_start_frame: int

The frame value of the beginning of the composition.

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

footage_layers: list[AVLayer]

A list of the composition layers whose source are footages.

footage_missing

footage_missing: bool

When True, the AVItem is a placeholder, or represents footage with a source file that cannot be found. 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.

frame_in_point

frame_in_point: int

The composition "work area" start (frames).

frame_out_point

frame_out_point: int

The composition "work area" end (frames).

frame_rate

frame_rate: float

The frame rate of the item in frames-per-second.

frame_time

frame_time: int

The playhead timestamp, in composition time (frame).

height

height: int

The height of the item in pixels.

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.

id

id: int

The item unique identifier.

in_point

in_point: float

The composition "work area" start (seconds).

is_composition

is_composition: bool

True if the item is a composition.

is_folder

is_folder: bool

True if the item is a folder.

is_footage

is_footage: bool

True if the item is a footage.

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).

layers

layers: list[Layer]

All the Layer objects for layers in this composition.

markers

markers: list[MarkerValue]

All the composition's 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.

name

name: str

The name of the item, as shown in the Project panel.

out_point

out_point: float

The composition "work area" end (seconds).

parent_folder

parent_folder: FolderItem | None = field(repr=False)

The parent folder of this item. None for the root folder.

pixel_aspect

pixel_aspect: float

The pixel aspect ratio of the item (1.0 is square).

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

resolution_factor: list[int]

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.

time

time: float

The playhead timestamp, in composition time (seconds).

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.

used_in

used_in: list[CompItem]

All the compositions that use this AVItem.

width

width: int

The width of the item in pixels.

work_area_duration

work_area_duration: float

The work area duration in seconds.

work_area_duration_frame

work_area_duration_frame: int

The work area duration in frames.

work_area_start

work_area_start: float

The work area start time relative to composition start.

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.