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

Handle internal seek on AnimationPlayer to process discrete correctly #94420

Merged
merged 1 commit into from
Jul 23, 2024

Conversation

TokageItLab
Copy link
Member

@TokageItLab TokageItLab commented Jul 16, 2024

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.

@TokageItLab TokageItLab added this to the 4.3 milestone Jul 16, 2024
@TokageItLab TokageItLab requested a review from a team as a code owner July 16, 2024 05:46
Copy link
Member

@fire fire left a 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?

@TokageItLab
Copy link
Member Author

TokageItLab commented Jul 22, 2024

@fire See ContributorChat's conversation with @QbieShay

https://chat.godotengine.org/channel/animation?msg=rRtWMWRL8TBPqWpnt

@akien-mga akien-mga merged commit 307efba into godotengine:master Jul 23, 2024
18 checks passed
@akien-mga
Copy link
Member

Thanks!

@hsandt
Copy link
Contributor

hsandt commented Nov 12, 2024

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.

@TokageItLab
Copy link
Member Author

TokageItLab commented Nov 12, 2024

@hsandt Can't you use Update Mode to "Continuous" and Interpolation Type to "Nearest"?

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

Successfully merging this pull request may close these issues.

4 participants