-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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
Add animation_started/finished
signals to AnimationTree
and fix time accuracy in StateMachine
#70278
Add animation_started/finished
signals to AnimationTree
and fix time accuracy in StateMachine
#70278
Conversation
7ad7315
to
0377bf9
Compare
Work in progress as there seems to be a problem with the StateMachine transition process. |
Perhaps related #55423 (comment) (probably not 🤷♂️) |
|
3b9cdd3
to
24ccbfa
Compare
Okay, fixed. The problem was that the time in the StateMachine was not a double but a float, so it was not precise enough, and the fade end was determined too early1. animation_tree_signal_test_statemachine.zip By the way, there is a issue with the "animation_started" signal not firing in travel mode with no connection, which is the same problem as in #70318. Currently, travel mode transitions with no connection do not do a 0-seek, so start cannot be detected. We will need to pick up it later. Footnotes
|
animation_started/finished
signals to AnimationTree
animation_started/finished
signals to AnimationTree
and fix time accuracy in StateMachine
df37b5c
to
b8d97a9
Compare
Included fix for #70318. Force playback from the head when teleporting travel (with no connection) from another state. |
b8d97a9
to
ff5c61e
Compare
ff5c61e
to
4cd144d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this makes sense so as not have to rely on the MethodTrack workaround, and while I was a little concerned with the implication of issues surrounding floating point precision, moving to double makes sense from a consistency standpoint nonetheless, so this all seems fine to me.
Thanks! |
I've been waiting for this for four years! Sorry... |
@TokageItLab Have you checked if this code can also be backported to 3.x? |
Unfortunately, this depends on a bit large refactoring done in #69336, so it would be difficult to backport. |
In the past, many times we received reports of problems with AnimationTree not firing signals for AnimationPlayer, since AnimationTree only gets the AnimationPlayer's animation list and the AnimationPlayer does not process anything.
However, there seemed to be a demand for signals, and a common workaround was to add a MethodTrack at the end of the Animation. This has caused also some reported problems in the past with MethodTracks at the end not being processed, but this should be fixed with the recent overhaul of the animation process.
But it is not wise to leave workarounds in place, so adding a signal to the AnimationTree eliminates the need for such workarounds.
I am not sure if only the animation name is sufficient as a signal argument. This means that it is currently impossible to identify which NodeAnimation processed the Animation.
The reason for this is that it is the NodeAnimation that can fire the signal, and the NodeAnimation itself does not have a name, its label is held by the NodeBlendTree or NodeStateMachine map. Well, considering that we are replacing a workaround that has a MethodTrack at the end of the animation, I guess this is sufficient.
Closes #28311 Fixes #70318
animsignal.mp4
animation_tree_signal_test.zip