copy_layers
Copies source layers or groups into a target sprite while preserving cels, opacity, blend modes, and user data; optionally replaces same-named top-level layers and appends missing frames.
Instructions
Copy layers from another sprite into the target, on top of its top level.
A group comes with all its layers, nested groups included. Cels keep their frame number, position, opacity and z-index; linked cels stay linked. Layer name, visibility, opacity, blend mode, colour and user data are copied. Both sprites must have the same colour mode (indexed copies palette indices as they are, so give both the same palette). A name already used at the target's top level is an error unless replace is true, which puts the copy in the old layer's place. Without create_missing_frames, cels past the target's last frame are skipped and counted. Tilemap layers cannot be copied. Source and target must be different files.
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": {
"target": "<target>",
"source": "<source>",
"layers": "<layers>"
},
"name": "copy_layers"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| layers | Yes | Source layers or groups | |
| source | Yes | Sprite file to copy from; it is not changed | |
| target | Yes | Sprite file. Relative paths resolve against the server root. | |
| replace | No | Replace a top-level target layer with the same name | |
| create_missing_frames | No | Append frames the target lacks (with the source durations) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||