Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AnimationTree::animation_started signal is not emitted when playing looped animations #94110

Open
TheWarmWaffle opened this issue Jul 9, 2024 · 5 comments

Comments

@TheWarmWaffle
Copy link

Tested versions

Reproducible in: 4.2.stable 4.2.2.stable

System information

Windows 10

Issue description

If a looping animation is played in an AnimationTree, it will not send the animation_started signal, this only affects the AnimationTree and not the AnimationPlayer.

Steps to reproduce

To start the non looping animation press space, to start the looping animation press tab, the output will say either tree started/finished for the AnimationTree, or Player started/finished for AnimationPlayer itself.

If you want to confirm that this bug is not reproducible on the AnimationPlayer itself, deactivate the AnimationTree, then in the script under the _input() function, uncomment the animation_player_input() and comment out animation_tree_input().

Minimal reproduction project (MRP)

AnimBugTest.zip

@Chaosus Chaosus changed the title AnimationTree animation_started signal is not emitted when playing looped animations AnimationTree::animation_started signal is not emitted when playing looped animations Aug 4, 2024
@Chaosus
Copy link
Member

Chaosus commented Aug 4, 2024

Not sure if this is not a desired behavior for that class

@AThousandShips
Copy link
Member

AThousandShips commented Aug 4, 2024

animation_started is only sent when calling play, not generally, this should be documented though

This used to be documented in 4.1 but was lost in the refactor:

Note: This signal is not emitted if an animation is looping or playbacked from the middle. Also be aware of the possibility of unseen playback by sync and xfade.

@TheWarmWaffle
Copy link
Author

TheWarmWaffle commented Aug 13, 2024

Note: This signal is not emitted if an animation is looping or playbacked from the middle. Also be aware of the possibility of unseen playback by sync and xfade.

It sounds pretty inconsistent, both with the AnimationPlayer, and itself. I don't think the signal would be used much if it's so restrictive on what can reliably be done with it, and will probably just have to be worked around by whoever was gonna use it anyway, making the signal pretty much useless.

The only way I've found a way around it is by checking which AnimationNode is currently playing every frame, which I don't think is Ideal.

@TheSofox
Copy link
Contributor

Located this to AnimationNode::NodeTimeInfo AnimationNodeAnimation::_process
The detection for animation_started and animation_finished is only processed if the animation isn't LOOP_LINEAR or LOOP_PINGPONG. It's also done by checking where the animation is currently at (at 0 or past the end).

@ydeltastar
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants