Hi everyone,
so I recently posted about issues trying to save a frame (here).
I think i tried pretty much everything now and somewhat consistently run into this behavior.
Take this script:
app.command.SaveFileCopyAs{
ui=false,
filename="C:\\Users\\XXXX\\Documents\\TestExport.png",
fromFrame=app.sprite.frames[1],
toFrame=app.sprite.frames[1]}
(Filepath censored. I don’t think it matters)
I run this script on a sprite with 2 frames and it will reliably export the first one.
If I change the from and toFrame arguments to app.sprite.frames[2], Aseprite will still export the first frame.
Now, if I change the argument to app.sprite.frames[3], Aseprite will ignore the fromFrame and toFrame argument and prompt me to okay the export of an animation as a series of single images (i.e., TestExport1.png, TestExport2.png).
This behaviour will now continue until I restart Aseprite. So even if I change the script back to the code snippet above, it will continue to always trying to export all frames as single images.
I then also tried giving fromFrame/toFrame an Integer:
app.command.SaveFileCopyAs{
ui=false,
filename="C:\\Users\\XXXX\\Documents\\TestExport.png",
fromFrame=tonumber(1),
toFrame=tonumber(1)
}
(tonumber just to make really sure lua sends a number. It does not seem to impact the behavior so it could be cut, I think)
This will now always export the second frame. If I ask it to export romFrame/toFrame = 2, it will export a black square. If I ask it to export 0, the export all frames behavior starts again.
I have not yet tried to see how fromFrame and toFrame behave when I give them an actual range to export, since my usecase is specifically throwing out single frames.
There is absolutely a chance that this is user error, I have no experience with Lua and am not able to properly debug what is going on. If this is the case I would be very grateful for any pointers as to what I am doing wrong.
If this is a bug, I would be super grateful if this could be fixed at some point or another way could be provided to save away a single frame. I really love aseprite and it would be a massive quality of life improvement.
Thanks so much!