While running the bellow command (via gitbash for the path niceties) over two different files, each with a single layer and multiple tags:
~/Downloads/Aseprite-v1.2.40/Aseprite-v1.2.40/Aseprite.exe -b king.aseprite silver_knight.aseprite --sheet ../spritesheets/characters.png --scale 2 --sheet-pack --list-tags --filename-format {tag}_{tagframe} --format json-array --data ../spritesheets/characters.json
The produced json has all the frames in the array, however the produces frame tags section in the meta object is problematic:
{
...
"meta": {
...
"frameTags": [
{ "name": "king_idle", "from": 0, "to": 7, "direction": "forward" },
{ "name": "king_run", "from": 8, "to": 15, "direction": "forward" },
{ "name": "king_death", "from": 16, "to": 21, "direction": "forward" },
{ "name": "king_attack1", "from": 22, "to": 25, "direction": "forward" },
{ "name": "king_attack2", "from": 26, "to": 29, "direction": "forward" },
{ "name": "king_attack3", "from": 30, "to": 33, "direction": "forward" },
{ "name": "king_hit", "from": 34, "to": 37, "direction": "forward" },
{ "name": "silver_knight_idle", "from": 0, "to": 10, "direction": "forward" },
{ "name": "silver_knight_run", "from": 11, "to": 18, "direction": "forward" },
{ "name": "silver_knight_attack1", "from": 19, "to": 25, "direction": "forward" },
{ "name": "silver_knight_attack2", "from": 26, "to": 32, "direction": "forward" },
{ "name": "silver_knight_death", "from": 33, "to": 43, "direction": "forward" },
{ "name": "silver_knight_hit", "from": 44, "to": 47, "direction": "forward" }
]
}
}
json frames = json_get_array( root, "frames );
json frame_tags = json_get_array( json_get_obj( root, "meta" ), "frameTags")
for( tag in frame_tags ) {
int from, to;
if( tag.name == "<tag>" ) {
from = tag.from;
to = tag.to;
}
for( i = from; i <= to; i++ ) {
extract_frame( frames, i );
}
}
While running the bellow command (via gitbash for the path niceties) over two different files, each with a single layer and multiple tags:
The produced json has all the frames in the array, however the produces frame tags section in the
metaobject is problematic:From the above it is both the
king_idleandsilver_knight_idlehave overlappingfrom->toframe numbers. This makes it pretty much impossible to extract which frames in the array are meant to be for which tag, when attempting to do something as follows (in peudo code):Aseprite and System version