Skip to content

Import options

ImportOptions

Options for importing a file into an After Effects project.

This is a parameter container used by Project.import_file(). It validates the import settings before the actual import operation.

Unlike most py_aep classes, ImportOptions has no chunk backing - import settings are not stored in the .aep binary format.

Example
from pathlib import Path
from py_aep import ImportOptions, ImportAsType

opts = ImportOptions(Path("footage/shot_001.png"))
opts.sequence = True
opts.import_as = ImportAsType.FOOTAGE

See: https://ae-scripting.docsforadobe.dev/other/importoptions/

Attributes

file

file: Path

The file to be imported. If a file is set in the constructor, you can access it through this attribute. Read / Write.

force_alphabetical

force_alphabetical: bool

When True and sequence is also True, use alphabetical order for sequence frame numbering. Read / Write.

import_as

import_as: ImportAsType

How to import the file. Read / Write.

sequence

sequence: bool

When True, import the file as part of a numbered image sequence. Read / Write.

Functions

can_import_as

can_import_as(type: int | ImportAsType) -> bool

Check whether the file can be imported as the given type.

Parameters:

Returns:

  • bool

    True if the file can be imported as type.

is_file_name_numbered

is_file_name_numbered() -> tuple[bool, int]

Check whether the filename ends with a number.

Returns:

  • bool

    A tuple of (is_numbered, first_number) where

  • int

    is_numbered is True when the filename stem ends with

  • tuple[bool, int]

    digits and first_number is the parsed integer value (or

  • tuple[bool, int]

    0 when not numbered).