-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
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 seek end loop anim. #85225
Fix seek end loop anim. #85225
Conversation
Should be tested against the changes in #85193 to see if changes are needed based on this
Also from the original PR #85186 (review):
|
Because it not use mod to go back to first key time when done. Seek to start = mod(0.1, 0.9) == 0.1: unchanged Seek pingpong to end = pingpong(0.9, 0.9) = 0.9 I cannot replicate the regression and would appreciate info on how to replicate the regression. |
I'm just quoting the comment to ensure it is recognised here, I didn't report it You can't supersed a merged PR, and it's already closed 🙂 |
The biggest problem with this implementation is that the loop animation does not loop when seeking beyond the length of the animation. If you seek 0.3 seconds from the 0.8 second point in a 0.9 length animation, it must be 0.2. There are enough use cases like Even if you do the check as in if (next_pos > len && cd.pos < len) {
looped_flag = Animation::LOOPED_FLAG_END;
}
if (!p_seeked && (cd.pos == 0 || cd.pos == len)) {
next_pos = Math::fposmod(next_pos, (double)len);
}
... it will cause the problem of not processing the first key at the point where the loop should occur due to seek. Since it is too rare case a important key at the end of a loop animation (and it is not supposed to be), and more often a important key at the beginning, so that check would cause more problems that the beginning key not being processed than the end key not being processed. If there are enough demands/samples for the use case of placing important keys at the end of loop animations with seeking, there may be room for improvement, but it should be in the key retrieval functions such as |
This is a PR that has already been closed once as #85186, so it is closed again. As noted above, there may be room for improvement in the handling of the last key (for Discrete/Method/Audio/AnimationPlayback Track, not Continuous) during seek,
but in any case to improve that, a different approach would need to be taken from this PR. |
Closes: #85220