-
-
Notifications
You must be signed in to change notification settings - Fork 21.6k
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
Fix methods may not be called at the end of the animation. #61836
Fix methods may not be called at the end of the animation. #61836
Conversation
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.
If delta is small enough, the animation should be stopped. The problem that needs to be fixed is not the comparison, but the way keys are gotten at the end of the animation.
d873da6
to
d223652
Compare
This should make the non-zero Consecutive small values are considered to be the end of the animation, and occasional small values are considered to be values as normal. |
I say again, it is a bad idea that using delta to assume end of the animation. When TimeScale is 0, there is a case where small deltas are generated continuously. |
There is no bug in TimeScale. Consider the case where the playback position stays in the same frame by TimeScale; In the case of directly setting a value, such as value track, it does not matter how many times it is set. However, in the case of firing events such as method track, it is wrong to fire it continuously but the animation itself is still in progress and has not ended. The current implementation prevents it. There is probably no need to change that. I simply say that delta should not be used as an end-of-animation flag/checking. |
d223652
to
627fb0b
Compare
Reset the internal |
Previously, the delta could be too small, preventing the methods at the end of the animation from being called.
627fb0b
to
2d092c0
Compare
Superseded by #61885. |
Previously, the delta could be too small, preventing the methods at the end of the animation from being called.
Fix #61766.
Fix #61853.
I think it is necessary to explain what I think and why.
I partially agree. The difference is that occasional small deltas (including 0) can actually be ignored, i.e., treated as normal deltas. Only consecutive small deltas are considered to be the end of the animation, that is, let go of the first small delta, and if the next delta is still small enough, the animation is stopped or finished.
This is the conclusion from cause to effect. So, it should be uncontroversial.
The question is whether the cause can be inferred from the result, i.e. if
delta==0
, the animation has ended/stopped. It doesn't actually hold, but if we use the word continuous to limit, that is, ifdelta==0
appears continuously, the animation has ended/stopped, it holds, because0
is also a small enough value.Simply put, my job is to remap the range of deltas. It is only valid for consecutive small values (from the second one).
It is common and normal to have a small enough value before ending or stopping. But the current implementation treats it as an end flag and discards it, this is what caused #61766.
I put
0
as the stop/finish flag because0
is special enough:Math::is_zero_approx(0)
istrue
, so it should be compatible with existing code, unlessMath::is_zero_approx(delta) && delta != 0
.