Ah, gotcha. The spine-godot documentation does link to the general runtimes guide, which describes the animation state API in more detail, which should clear up the confusion. I can see now though that this might be confusing for someone who's coming from the Godot APIs.
Our API has been like this since 2013, and I'm afraid we can't change it to work more like what you are used from Godot, as that would break all projects using our runtime. However, it should be easy to add such a method yourself to a node deriving from SpineSprite
. That method would take all the same arguments as set_animation
but would first check if the animation that's currently being played back has the same name as the name passed to your set_animation
"wrapper".
You can get the name of the currently playing animation on track 0 like this:
get_animation_state().get_current(0).get_animation().get_name()
Just replace the 0
with whatever track you are interested in. Also note that get_current()
can return nil
in case no animation has been queued on that track.