nklbdev / godot-4-importality

Universal raster graphics and animations importers pack
MIT License
337 stars 7 forks source link

Is there a way to Trim imports? #24

Open Kylemcarthur opened 7 months ago

Kylemcarthur commented 7 months ago

Title. Latest Aseprite (1.3.2) and Godot (4.2.1) versions.

image

Also, why are the frame durations all set to 0.1 and 1 FPS? That's not how it's set in Aseprite. Also, is there any sort of layer control? It looks like it's just defaulting to visible layers in the Aseprite document.

I've gone through every bit of documentation I can find on this plugin, and there really just isn't sufficient explanation about what this import is supposed to do exactly or how to get it to do whatever that is. It's currently faster and easier to just do the exports manually out of aseprite, so I hope I'm just being a dingus and doing things wrong.

nklbdev commented 7 months ago

I'm sorry, I'm incredibly busy right now. I will only be able to answer you at the end of the week.

Aseprite cannot actually guarantee a constant frame rate. It can only set the same duration in each frame. But you can edit it in the properties of any frame.

Therefore, when importing into Godot, Importality cannot specify the FPS of 10 or 20 frames per second. It has to specify an explicit duration in each frame individually.

Now in your screenshot, each frame has duration of 100 milliseconds (0.1 seconds).

You can control the animation FPS in runtime or in a post-import script as a multiplier to the overall animation speed.

For example, if you set it to 2, the animation will run twice as fast as in Asepritе.

You can trim sprites in atlas (to save memory) but you can not trim size of sprite. Sprite will have same size as in Aseprite. image