aseprite
aseprite copied to clipboard
Slices are exported even for non-tagged frames
I know slices are kind of broken right now and need to be reimplemented, but I thought I'd report this just in case.
- Create an aseprite file with 3 frames.
- Add a slice, and resave it on every frame (to ensure it gets persisted and exported for every frame).
- Add a tag "Sheet" on the 2nd frame.
- Generate the sprite sheet JSON from your file with this command:
aseprite.exe -b --list-slices --tag Sheet --data data.json
Actual result: in the generated JSON file, the slices have been added for all 3 frames. Expected result: in the generated JSON file, the slices have been added for the 2nd frame only (because it's the only one with the "Sheet" tag).
Aseprite and System version
- Aseprite version: 1.2.40 and 1.3-beta21
- System: Windows 7 (yeah, I know)
Related, the generated slice frame indexes are inconsistent in cases where you use tags.
Example:
- Create an aseprite file with 3 frames.
- Add a slice on the 2nd frame, and resave it on the 3rd frame, to ensure it gets persisted and exported for these two frames.
- Add a tag "Sheet" on the 2nd and 3rd frame. Only the 1st frame has no tag.
- Generate the sprite sheet JSON from your file with this command:
aseprite.exe -b --list-slices --tag Sheet --data data.json
Actual result: in the generated JSON file, the slice contains frame:0 and frame:2 (shifted due to the first frame which is not tagged). Expected result: in the generated JSON file, the slice contains frame:0 and frame:1.
Thanks for this report @thomasgoldstein. This isn't a bug. At the moment, this is the normal behavior. Slices should be refactored (#721) / some behavior should be changed (#3142). All this is a work in progress.
Explanation of what is happening on First case and Second case
- No matter which frame you make a new
slice
, always this action will create aslice
+slice keyframe
starting from first frame, then each intention to modify thatslice
in a particular frame will add a newslice keyframe
in that frame. - The flags
--list-slices
lists-tags
list-layers
will put all the data in themeta
section of the json file from the.aseprite
source file. The frame numbers in the slice list are referred to the source file (-tag Sheet
has no effect inmeta
section). - The
--tag Sheet
flag only has an effect for the generation of theframes
array. As expected, only the frames included in thetag
are shown. - Note: in the particular case:
aseprite.exe -b --list-slices --tag Sheet --data data.json sample.aseprite
you can't infer whichslice
belongs toSheet
frames. The solution to this is to add the--list-tags
flag, with this you will get the number of the frame that theSheet
tag belongs to.
Mechanism of slice
+ slice keyframe
(Aseprite current version 1.2.40):
- Suppose a Sprite with 10 frames. (frame 1 to 10)
- Add a
slice
at frame 5. This action will add aslice
(that's what you see), but the Aseprite code adds aslice
+slice keyframe
at frame 1. Thisslice
can be seen on all frames. - Go to frame 8, click on the
slice
and modify its bounds. This action will add a newslice keyframe
at frame 8. So, we got: aslice
that can be seen in all frames, frames 1 to 7 with bounds set in "2" and frames 8 to 10 with bounds set in "3".
What do you think @dacap? Are there plans to modify the behavior of the list
flag when a particular tag is required in the CLI/Export Sprite Sheet dialog?
Hi @Gasparoken, thanks for your answer. Slices are still very confusing to me, as I have no choice but to export them to figure out what's really saved in the aseprite file. Or maybe I'm not looking at the right places. Looking forward to their updated version.