CompItem (Composition)¶
CompItem
dataclass
¶
CompItem(comment: str, item_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, display_start_time: float, frame_blending: bool, hide_shy_layers: bool, layers: list[Layer], markers: list[Marker], 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: int, in_point: float, frame_in_point: int, out_point: float, frame_out_point: int, frame_time: int, time: float)
Bases: AVItem
Object storing information about a composition.
Attributes:
| Name | Type | Description |
|---|---|---|
bg_color |
list[float]
|
The background color of the composition. The three array values specify the red, green, and blue components of the color. |
display_start_frame |
int
|
The frame value of the beginning of the composition. |
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. |
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. |
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. |
layers |
list[Layer]
|
All the Layer objects for layers in this composition. |
markers |
list[Marker]
|
All the composition's markers. |
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 |
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 |
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. |
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 |
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. |
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 |
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. |
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]. |
time_scale |
int
|
The time scale, used as a divisor for some time values. |
in_point |
float
|
The composition "work area" start (seconds). |
frame_in_point |
int
|
The composition "work area" start (frames). |
out_point |
float
|
The composition "work area" end (seconds). |
frame_out_point |
int
|
The composition "work area" end (frames). |
frame_time |
int
|
The playhead timestamp, in composition time (frame). |
time |
float
|
The playhead timestamp, in composition time (seconds). |
work_area_start
property
¶
The work area start time relative to composition start.
work_area_start_frame
property
¶
The work area start frame relative to composition start.
composition_layers
property
¶
composition_layers: list[AVLayer]
A list of the composition layers whose source are compositions.
footage_layers
property
¶
footage_layers: list[AVLayer]
A list of the composition layers whose source are footages.
layer
¶
layer(name: str | None = None, index: int | None = None, other_layer: Layer | None = None, rel_index: int | None = None) -> Layer | None
Get a Layer object by name, index, or relative to another layer.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str | None
|
The name of the layer to return. |
None
|
index
|
int | None
|
The index position of the layer to return. |
None
|
other_layer
|
Layer | None
|
A Layer object to use as a reference for the relative index position of the layer to return. |
None
|
rel_index
|
int | None
|
The index position of the layer relative to the other_layer to return. |
None
|