repair_animation
Fixes animation structure by ensuring missing layers, setting layer order, and handling cels outside frame ranges, validating all changes before saving.
Instructions
Fix the structure of an animation; everything is checked before anything changes.
ensure_layers adds missing layers as empty image layers on top of their parent.
layer_order puts the listed layers (all in the same group, or all top level) in that
order, bottom first, in the stack slots they already hold; unlisted layers stay put.
layer_frame_ranges finds layers with pixels in frames (within frames) outside their
range (it may name a layer ensure_layers creates, by path or bare name);
out_of_range decides what happens to them: "report" only lists them and
changes nothing, "hide" makes each such layer invisible (its cels stay), "delete"
deletes the out-of-range cels. Locked layers are refused for hide, delete and moves.
changed is false when nothing needed fixing; the file is then not rewritten. When
any step fails, nothing is saved.
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": "repair_animation"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Sprite file. Relative paths resolve against the server root. | |
| frames | No | Frames: a number, "1-4", "1-4,7" or "all" (1-based) | all |
| layer_order | No | Sibling layers in the wanted order, bottom first | |
| out_of_range | No | What to do with cels outside a layer's frame range | report |
| ensure_layers | No | Layers to create when missing; 'group/name' creates it in that group | |
| layer_frame_ranges | No | Layer name or path -> the frames it may have pixels in, e.g. {"Sword": "3-5"}; a group covers all its layers |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||