Assets

Assets are usually referenced by layers of the appropriate type.

Image

Represents a (static) image

Attribute Type Description
id string

Unique identifier used by layers when referencing this asset

nm string

Human readable name

u string

Path to the directory containing a file

p string

Filename or data url

e 0-1 integer

Whether the file is embedded

w number

Width of the image

h number

Height of the image

t string = 'seq'

Marks as part of an image sequence if present

sid string

One of the ID in the file's slots

If the image is embedded, u is empty and p contains a base64-encoded data url:

{
    "id": "my image",
    "h": 512,
    "w": 512,
    "e": 1,
    "u": "",
    "p": "data:image/png;base64,..."
}

If the image is not embedded, u will contain the path to the directory containing the image and p will have the filename.

So for example if you want to store the image at /path/to/images/image.png, the asset will look something like this:

{
    "id": "my image",
    "h": 512,
    "w": 512,
    "e": 0,
    "u": "/path/to/images/",
    "p": "image.png"
}

It works similarly for external images. If you want to store the image at https://example.com/images/image.png, you'd have:

{
    "id": "my image",
    "h": 512,
    "w": 512,
    "e": 0,
    "u": "https://example.com/images/",
    "p": "image.png"
}

Sound

Similar to Image but for audio files.

Attribute Type Description
id string

Unique identifier used by layers when referencing this asset

nm string

Human readable name

u string

Path to the directory containing a file

p string

Filename or data url

e 0-1 integer

Whether the file is embedded

Precomposition

You can think of precompositions as self-contained animation within the main animation file that can be referenced using precomp layers.

Within a precomposition you can have precomp layers showing other precompositions, as long as you don't create a dependency cycle.

You can find more details in the Precompositions page.

Attribute Type Description
layers array of Precomposition Layer or Solid Color Layer or Image Layer or Null Layer or Shape Layer or Text Layer or Audio Layer or Camera Layer or Data Layer

An array of layers (See: Lists of layers and shapes)

id string

Unique identifier used by layers when referencing this asset

nm string

Human readable name

fr number

Framerate in frames per second

xt 0-1 integer

Extra composition

Follows a rather extreme example, that uses precompositions inside precompositions to generate a fractal:

Data Source

Points to a JSON file for data.

Attribute Type Description
id string

Unique identifier used by layers when referencing this asset

nm string

Human readable name

u string

Path to the directory containing a file

p string

Filename or data url

e 0-1 integer

Whether the file is embedded

t integer = 3

Type