viniciusgerevini / godot-aseprite-wizard

Godot Editor plugin to help import Aseprite animations to AnimationPlayers, AnimatedSprites and SpriteFrames.
MIT License
887 stars 42 forks source link

Is there a way or workaround to reach a perfect frequency, like 12 FPS? #172

Closed sim-kaart closed 8 hours ago

sim-kaart commented 4 weeks ago

All our animations are set up at 83 ms per frame in Aseprite. I would love for that to convert to 12 FPS. Is there a way or workaround to reach a frame length closer to 83.3333 ms?

viniciusgerevini commented 4 weeks ago

Oh, I see. At the moment, the import to SpriteFrames always round the result up. It's like that because if I remember correctly when I first implemented this plugin the speed should be set as an int. I see now that float works just fine so maybe I can remove the rounding altogether.

In the meantime, if you want to test how this would look like in your local you can change the _calculate_fps method in /addons/AsepriteWizard/creators/sprite_frames/sprite_frames_creator.gd . Just remove the ceil call on line 164 and you should get a number closer to 12.

An alternative without changing the plugin is using a Sprite/AnimationPlayer instead, because those would use the value as-is without calculating the FPS and losing precision. However, I understand that's not a 1-1 swap as you will be dealing with one extra node.

I'll put some extra thought to confirm removing the rounding won't break anything else. I think it makes sense to release it as an option. Thanks.

sim-kaart commented 3 weeks ago

Ah! I see what you mean. Thanks, I will try to change it locally for now and see what that does :)