Render an animation to a sprite sheet PNG
riv_render_spritesRender N evenly-spaced frames from a .riv animation or state machine into a grid sprite sheet PNG, with matching JSON metadata for frame layout and playback.
Instructions
Render N evenly-spaced frames of a .riv animation/state machine into a single grid sprite sheet PNG (columns = ceil(sqrt(N))). Writes the PNG plus a JSON metadata file (cellW/cellH/cols/rows/count/fps) alongside.
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": {
"path": "<path>"
},
"name": "riv_render_sprites"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fps | No | Metadata playback fps (default: count/duration) | |
| out | No | Output PNG path (default: alongside the .riv); metadata is written next to it with a .json extension | |
| path | Yes | Path to the .riv file | |
| count | No | Number of frames (default 16) | |
| width | No | Output width in px (default: artboard width) | |
| height | No | Output height in px (default: keeps the artboard aspect ratio) | |
| artboard | No | Artboard name (default: first artboard) | |
| duration | No | Seconds spanned by the frames (default: one animation loop, or 2s) | |
| animation | No | Animation name; ignored when stateMachine is set (default: the first state machine, else the first animation) | |
| background | No | CSS background color (default: transparent) | |
| stateMachine | No | State machine name (takes precedence over animation) |