Edit an existing .riv file
riv_editModify existing .riv files losslessly: set properties, edit text runs, delete objects with subtree/reference remapping, and change animation keyframes, then render a preview of the result.
Instructions
Modify an existing .riv (lossless roundtrip): set any property, change named text runs, delete objects (with automatic subtree + reference remapping), or edit keyframes on an existing animation (op=setKeyframes). Use riv_dump to find object indices/names. Renders a preview of the result. setKeyframes: target an animated object via index/name(+type), give 'animation' (LinearAnimation name) and 'property' (x/y/rotation/scaleX/scaleY/opacity/width/height — rotation in degrees), then 'keyframes' (array of {frame,value,easing}). 'mode': replace (default, swaps the whole track) | add (appends keyframes, creating the track if absent) | remove (deletes keyframes matching the given frame numbers; keyframes[].value/easing are ignored).
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>",
"edits": "<edits>"
},
"name": "riv_edit"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Source .riv path | |
| edits | Yes | Edit operations, applied in order | |
| outPath | No | Output path (default: overwrite source) |