add_frame
Adds an empty frame at the end of an animation or duplicates an existing frame directly after it, with an optional duration in milliseconds.
Instructions
Add a frame: an empty one goes at the end, a copy goes right after the frame it copies.
Args:
duration_ms: The new frame's duration in milliseconds (default 100). With
`copy_from` it is set on the copy; the frame copied keeps its own.
copy_from: If given (1-based), the new frame duplicates that frame and is
**inserted directly after it**, so every later frame is renumbered: on a red,
blue sprite, `copy_from=1` gives red, red, blue, the copy being frame 2 and
blue moving from 2 to 3. Copying the last frame moves nothing. Tags follow
their frames: one that covered the copied frame grows by one to take in the
copy, and one after it moves up by one. Must name an existing frame: an
out-of-range number is rejected, not clamped. Without `copy_from` the new
frame is empty, goes at the end, and nothing moves.
Returns `newFrame`, the number of the frame this call added (with `copy_from`, always
`copy_from + 1`), and the new `frameCount`. `inserted` says whether existing frames
were renumbered; when they were, `renumbered_from` is the first number affected: every
frame that had that number or a higher one before the call is one higher after it, so
a caller holding frame numbers from before the call adds one to each of those.
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": {
"filename": "<filename>"
},
"name": "add_frame"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filename | Yes | ||
| copy_from | No | ||
| duration_ms | No | Default: 100. |