Skip to content

File Source

FileSource

FileSource(
    alpha_mode: AlphaMode,
    conform_frame_rate: int,
    field_separation_type: FieldSeparationType,
    has_alpha: bool,
    high_quality_field_separation: bool,
    invert_alpha: bool,
    is_still: bool,
    loop: int,
    premul_color: list[float],
    file: str,
    file_names: list[str],
    target_is_folder: bool,
    file_attributes: dict[str, Any] = dict(),
)

Bases: FootageSource

The FileSource object describes footage that comes from a file.

Info

FileSource is a subclass of FootageSource object. All methods and attributes of FootageSource are available when working with FileSource.

See: https://ae-scripting.docsforadobe.dev/sources/filesource/

Attributes

alpha_mode

alpha_mode: AlphaMode

Defines how the alpha information in the footage is interpreted. If has_alpha is False, this attribute has no relevant meaning.

conform_frame_rate

conform_frame_rate: int

A frame rate to use instead of the native_frame_rate value. If set to 0, the native_frame_rate is used instead.

field_separation_type

field_separation_type: FieldSeparationType

How the fields are to be separated in non-still footage. It is an error to set this attribute if is_still is True. It is an error to set this value to FieldSeparationType.OFF if remove_pulldown is not PulldownPhase.OFF.

file

file: str

The full file path.

file_attributes

file_attributes: dict[str, Any] = field(
    default_factory=dict
)

Format-specific metadata extracted from the source file header stored in the project.

For PSD (Photoshop) sources, the following keys are available:

  • psd_layer_index (int): Zero-based index of this layer within the PSD file. 0xFFFF means merged/flattened.
  • psd_group_name (str): PSD group/folder that contains this layer (e.g. "PAINT 02").
  • psd_layer_count (int): Total number of layers in the source PSD.
  • psd_canvas_width (int): Full PSD canvas width in pixels.
  • psd_canvas_height (int): Full PSD canvas height in pixels.
  • psd_bit_depth (int): Bit depth per channel (8, 16, 32).
  • psd_channels (int): Number of color channels (3 for RGB, 4 for RGBA/CMYK).
  • psd_layer_top (int): Layer bounding-box top (pixels, can be negative if the layer extends above the canvas).
  • psd_layer_left (int): Layer bounding-box left.
  • psd_layer_bottom (int): Layer bounding-box bottom.
  • psd_layer_right (int): Layer bounding-box right.

file_names

file_names: list[str]

The filenames if the footage is an image sequence.

has_alpha

has_alpha: bool

When True, the footage has an alpha component. In this case, the attributes alpha_mode, invert_alpha, and premultiplied have valid values. When False, those attributes have no relevant meaning for the footage.

high_quality_field_separation

high_quality_field_separation: bool

When True, After Effects uses special algorithms to determine how to perform high-quality field separation.

invert_alpha

invert_alpha: bool

When True, an alpha channel in a footage clip or proxy should be inverted. This attribute is valid only if an alpha is present. If has_alpha is False, or if alpha_mode is AlphaMode.IGNORE, this attribute is ignored.

is_solid

is_solid: bool

Whether this is a solid source.

is_still

is_still: bool

When True the footage is still; When False, it has a time-based component. Examples of still footage are JPEG files, solids, and placeholders with a duration of 0. Examples of non-still footage are movie files, sound files, sequences, and placeholders of non-zero duration.

loop

loop: int

The number of times that the footage is to be played consecutively when used in a composition.

missing_footage_path

missing_footage_path: str

The missing footage path if the footage is missing, else empty.

premul_color

premul_color: list[float]

The color to be premultiplied. This attribute is valid only if the alpha_mode is AlphaMode.PREMULTIPLIED.

target_is_folder

target_is_folder: bool

True if the file is a folder, else False.