-
-
Notifications
You must be signed in to change notification settings - Fork 21.9k
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
Handle internal seek on AnimationPlayer to process discrete correctly #94420
Handle internal seek on AnimationPlayer to process discrete correctly #94420
Conversation
5f442b0
to
98dbd86
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.
I am having trouble thinking through the consequences of this pr. Is there test cases? Approving because it's your expertise.
Edited:
Should we use the testing system to encode our current preferences into test cases?
@fire See ContributorChat's conversation with @QbieShay https://chat.godotengine.org/channel/animation?msg=rRtWMWRL8TBPqWpnt |
Thanks! |
I understand the new consistent design regarding usage of the next key in discrete mode, but my issue is that it also applies to normal timeline scrubbing in the editor Animation Player panel, not just when pressing the Play Backwards button. And I scrub left and right to see what my animation looks like around an area, without the intention of "simulation a play backwards". That makes the preview unstable (real use case: I swap body part sprites in my animation using the visible flag, and so it's important that they appear correctly at a given time). The last comment on said issue suggests to use "InterpolateContinuous+Nearest" in order to force usage of the previous key, however I don't see any such parameter (I can only set the Update Mode to Continuous, Discrete or Capture). I opened a discussion for this: godotengine/godot-proposals#11139 so we can discuss these issues further without cluttering this already merged PR. |
@hsandt Can't you use Update Mode to "Continuous" and Interpolation Type to "Nearest"? |
Discrete mode gets the previous key during seek, but when it is playing backwards, it gets the next key in time. This could cause a problem since time is going backwards when stopping, and that is being treated as a reverse playback seek
As for stopping, restarting, the key must be obtained in Exact mode not Nearest mode, just as start playback. It should be treated as an internal seek.
I cannot determine if it is correct behavior of retrieving the previous key when seeking. I believe this has been the old behavior. And I expect it is a hack to process the last key after crossing a key, because in the past it was not possible to get the delta correctly when seeking (I remember I have fixed that at early 4.0). So it may be a behavior that should be fixed now that we are able to get the delta. I will send another PR for about it later if needed.