Import a Lottie/bodymovin JSON as a Rive scene fragment (art + timing + easing)
riv_lottie_importConvert Lottie JSON animations into riv_create scene fragments, preserving keyframed timing, bezier easing, layer hierarchy, and gradients for direct splicing into your scene spec.
Instructions
Convert a Lottie (bodymovin, .json) animation — the format of LottieFiles' free animation library — into a riv_create scene fragment. Unlike riv_import_svg (shapes only), this keeps the keyframed timing: position, rotation, scale and opacity with their exact bezier easing (not mapped to a named preset), shape/null/precomp layer hierarchy, solid layers, gradient fills, stroke trim-path animation, and layer in/out visibility windows. Writes a scene-fragment JSON with {groups,shapes,animations} plus a rendered preview and a coverage/warnings summary. Since the fragment includes animations (which riv_create's "imports" mechanism does not merge), splice its groups/shapes/animations arrays directly into your riv_create scene spec instead of using "imports". Supported: shape layers (path/ellipse/rect/star/polygon/fill/stroke/gradient/trim/nested groups), null layers, solid layers, one level of precomp inlining, parented layers, hold and bezier easing. Not imported (counted in coverage.skipped, not silently dropped): text layers, masks, track mattes, repeaters, merge-paths, path/gradient-position keyframe morphing (frozen to first frame + warning), time-remapped precomps, expressions.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"outSpec": "<outSpec>"
},
"name": "riv_lottie_import"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| json | No | Inline Lottie JSON text (alternative to path) | |
| path | No | Path to the Lottie .json file | |
| outSpec | Yes | Output scene-fragment JSON path (e.g. anim.scene.json) | |
| idPrefix | No | Prefix for generated group/shape ids (avoid collisions) |