poohcom1 / godot-animated-sprite-2-player

A Godot addon to convert animated sprite frames to animations in an animation player.
https://godotengine.org/asset-library/asset/1605
MIT License
41 stars 3 forks source link

Suggestion: auto-generate RESET animation #13

Open hsandt opened 1 month ago

hsandt commented 1 month ago

Not a big deal as this plugin is only about two tracks: Frame and Animation which are easy to generate RESET tracks for using:

click on the first key of every unique track > right-click > Add Reset Value(s)

However, because of https://github.com/godotengine/godot/issues/85781 we must also remember to set interpolation mode to Discrete of both RESET tracks to avoid warnings. Do this for many animated entities and that's a lot of extra boilerplate work.

So if the plugin was able to detect unique tracks and add them to the RESET animation, it would be great.

We'd need to decide what the RESET values would be though. Maybe we could add a parameter field besides AnimatedSprite2D/3D Node, "RESET animation" which would be "default" by default. Or we could just pick the first value we find across animations, but then we'd have to print Output to remember user to customize the RESET values manually if needed after Import.

Note: RESET animation is not required, but my code explicitly refreshes animation by playing Reset because of this bug: https://github.com/godotengine/godot-proposals/issues/6417

poohcom1 commented 1 month ago

I think just using the first animation in the SpriteFrame resource should be good enough, most people probably have that animation as their "idle" or starting animation.

Maybe we could add a parameter field besides AnimatedSprite2D/3D Node, "RESET animation" which would be "default" by default.

If we go this route ideally it would be a drop-down list of options based on the currently selected animation player, but this might be a bit complicated.

I'm okay with both solutions, if you plan on implementing this I'll leave it up to you.