Assets
Assets are usually referenced by layers of the appropriate type.
Asset
Composition Diagram for Asset
Image
Represents a (static) image
Composition Diagram for Image
Attribute | Type | Title | Description |
---|---|---|---|
nm |
string |
Name |
Human readable name, as seen from editors and the like |
mn |
string |
Match Name |
Match name, used in expressions |
id |
string |
ID |
Unique identifier used by layers when referencing this asset |
p |
string |
File Name |
Name of the asset file or a data url |
u |
string |
File Path |
Path to the asset file |
e |
0-1 integer |
Embedded |
If '1', 'p' is a Data URL |
sid |
string |
Slot Id |
Identifier to look up the slot |
w |
number |
Width |
Width of the image |
h |
number |
Height |
Height of the image |
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.
Composition Diagram for Sound
Attribute | Type | Title | Description |
---|---|---|---|
nm |
string |
Name |
Human readable name, as seen from editors and the like |
mn |
string |
Match Name |
Match name, used in expressions |
id |
string |
ID |
Unique identifier used by layers when referencing this asset |
p |
string |
File Name |
Name of the asset file or a data url |
u |
string |
File Path |
Path to the asset file |
e |
0-1 integer |
Embedded |
If '1', 'p' is a Data URL |
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.
Composition Diagram for Precomposition
Attribute | Type | Title | Description |
---|---|---|---|
nm |
string |
Name |
Human readable name, as seen from editors and the like |
mn |
string |
Match Name |
Match name, used in expressions |
id |
string |
ID |
Unique identifier used by layers when referencing this asset |
layers |
array of Layer |
Layers |
Layers |
fr |
number |
Framerate |
Framerate in frames per second |
xt |
0-1 integer |
Extra |
Extra composition |
Follows a rather extreme example, that uses precompositions inside precompositions to generate a fractal:
{lottie:fractal.json:512:512}
Data Source
Points to a JSON file for data.
Composition Diagram for Data source
Attribute | Type | Title | Description |
---|---|---|---|
nm |
string |
Name |
Human readable name, as seen from editors and the like |
mn |
string |
Match Name |
Match name, used in expressions |
id |
string |
ID |
Unique identifier used by layers when referencing this asset |
p |
string |
File Name |
Name of the asset file or a data url |
u |
string |
File Path |
Path to the asset file |
e |
0-1 integer |
Embedded |
If '1', 'p' is a Data URL |
t |
integer = 3 |
Type |
Type |