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.

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!

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.

3 participants