A shape layer’s shapes array, and a group’s it array, hold
elements of four kinds. Shapes give geometry only; a style paints the shapes listed
before it in the same group; modifiers change the shapes before them; groups nest.
Earlier items are drawn on top. Elements marked “docs” are from Lottie Docs, not the
Lottie specification.
Common keys
| Key | Meaning |
|---|---|
ty | Element type, a two-letter string. |
nm | Name. |
hd | Hidden. |
d | On shapes: direction, 1 normal or 3 reversed. It matters to trim paths. |
mn, ix, cl, ln, bm | docs: After Effects match name, property index, CSS class, HTML id, blend mode. |
Element types
ty | Element | Kind | Keys |
|---|---|---|---|
rc | Rectangle | shape | p centre, s size, r corner radius. |
el | Ellipse | shape | p centre, s size. |
sr | Polystar | shape | p centre, pt number of points, r rotation, or outer radius, os outer roundness (%), ir inner radius and is inner roundness (stars only), sy 1 star or 2 polygon. |
sh | Path | shape | ks: an animated Bézier path. |
fl | Fill | style | c colour, o opacity (0 to 100), r fill rule (1 non-zero, 2 even-odd). |
st | Stroke | style | c colour, o opacity, w width, lc cap (1 butt, 2 round, 3 square), lj join (1 miter, 2 round, 3 bevel), ml miter limit (ml2 animated), d dashes. |
gf | Gradient fill | style | g colours, s start point, e end point, t type (1 linear, 2 radial; docs 3 conic), h highlight length (%), a highlight angle, o opacity, r fill rule. |
gs | Gradient stroke | style | The gradient keys of gf and the stroke keys of st (without c). |
no | No style | style | docs: o opacity; paints nothing. |
gr | Group | group | it the elements, ending with a transform; np number of properties; docs cix property index and bm blend mode. |
tr | Transform | group | The last item of a group: a, p, s, r, o, sk, sa, as the layer transform. |
tm | Trim path | modifier | s start and e end (0 to 100), o offset (degrees, wraps around), m 1 parallel (each shape trimmed alone) or 2 sequential (all shapes as one path). |
rp | Repeater | modifier | docs: c copies, o offset, m composite (1 below, 2 above), tr the transform applied to each copy, which adds so and eo, the opacity of the first and last copy. |
rd | Rounded corners | modifier | docs: r radius. |
pb | Pucker and bloat | modifier | docs: a amount in percent; negative puckers, positive bloats. |
tw | Twist | modifier | docs: a angle, c centre. |
mm | Merge | modifier | docs: mm mode: 1 normal, 2 add, 3 subtract, 4 intersect, 5 exclude intersections. |
op | Offset path | modifier | docs: a amount, lj join, ml miter limit. |
zz | Zig zag | modifier | docs: r ridges per segment, s amplitude, pt point type (corner or smooth). |
Stroke dashes
The d array of a stroke holds entries {"n": type, "nm": name,
"v": length}, where n is d dash, g gap or
o offset. Dashes and gaps alternate, starting with a dash; an odd count
repeats with dashes and gaps swapped. A single o entry shifts the
pattern.
Example
{ "ty": "gr", "it": [
{ "ty": "el", "p": { "a": 0, "k": [0, 0] }, "s": { "a": 0, "k": [100, 100] } },
{ "ty": "fl", "c": { "a": 0, "k": [1, 0.5, 0] }, "o": { "a": 0, "k": 100 }, "r": 1 },
{ "ty": "tr", "p": { "a": 0, "k": [256, 256] }, "a": { "a": 0, "k": [0, 0] },
"s": { "a": 0, "k": [100, 100] }, "r": { "a": 0, "k": 0 }, "o": { "a": 0, "k": 100 } }
] }