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

Fix seeking Animation immediately after playback for Discrete track #92861

Conversation

TokageItLab
Copy link
Member

@TokageItLab TokageItLab commented Jun 7, 2024

Reorganized #92126. Also, I believe the #92840 problem is mainly related to the editor. The seek(0) by stop() was processed incorrectly and the negative value for reverse playback was not propagated to the AnimationMixer on the first frame immediately after playback.

@KoBeWi
Copy link
Member

KoBeWi commented Jun 7, 2024

It does not fix #92840
If you run the MRP the animation is still broken.

@TokageItLab
Copy link
Member Author

Oh, it may not be essentially a Discrete issue. I recall a problem being reported somewhere earlier where the beginning of the animation was processed when playing backwards from a position beyond the length of the animation. At least for the Discrete playback issue, this PR will fix that.

@TokageItLab TokageItLab force-pushed the fix-animation-player-just-after-started branch from 52987a2 to d6c0b57 Compare June 7, 2024 19:57
@TokageItLab
Copy link
Member Author

@KoBeWi Okay, I see the problem, #92840 is not only in backward, but also in normal playback, where the RESET track is being played instead of the first frame if there is no key there. This is the intended behavior for deterministic, but if deterministic is disabled, the intended behavior should be to do nothing. I added a fix for that.

When Deterministic is enabled, RESET may not occur depending on the way the backward playback, but this is a problem that depends on the behavior of the Discrete key by seeking and the deletion of the cache by stopping, well, the complex combination of the Discrete key and Deterministic is considered to be a rare case so I assume it is okay for now.

@TokageItLab TokageItLab marked this pull request as draft June 7, 2024 20:25
@KoBeWi
Copy link
Member

KoBeWi commented Jun 7, 2024

Ok now it's fixed. I forgot to mention that my original issue occurred without RESET animation, but it doesn't seem to make difference.

@TokageItLab TokageItLab marked this pull request as ready for review June 7, 2024 20:58
@TokageItLab TokageItLab force-pushed the fix-animation-player-just-after-started branch from d6c0b57 to fd69877 Compare June 7, 2024 21:23
@TokageItLab
Copy link
Member Author

TokageItLab commented Jun 7, 2024

I also added a fix for the regression of the backwards seek (mainly for editor), which seems to have been occurred in dev5.

I feel that the other track types should be fixed as well, but if we do that, we need to handle all the events between seeks as mentioned in #92805 (comment). Although for Discrete, this is not necessary since it will be overriding only one property.

@TokageItLab TokageItLab force-pushed the fix-animation-player-just-after-started branch from fd69877 to 9e6afe8 Compare June 7, 2024 21:36
@TokageItLab TokageItLab requested a review from a team as a code owner June 7, 2024 21:36
@TokageItLab TokageItLab force-pushed the fix-animation-player-just-after-started branch from 9e6afe8 to 59916f7 Compare June 7, 2024 22:59
@TokageItLab TokageItLab requested review from a team as code owners June 7, 2024 22:59
@TokageItLab TokageItLab force-pushed the fix-animation-player-just-after-started branch 2 times, most recently from 65dc678 to 6c09dda Compare June 8, 2024 13:07
@TokageItLab TokageItLab force-pushed the fix-animation-player-just-after-started branch from 6c09dda to bea47d8 Compare June 8, 2024 13:09
@akien-mga akien-mga merged commit 3d170c5 into godotengine:master Jun 10, 2024
16 checks passed
@akien-mga
Copy link
Member

Thanks!

@akien-mga akien-mga changed the title Fix seeking Animation immediate after playback for Discrete track Fix seeking Animation immediately after playback for Discrete track Jun 20, 2024
@TokageItLab TokageItLab deleted the fix-animation-player-just-after-started branch June 29, 2024 11:45
MewPurPur pushed a commit to MewPurPur/godot that referenced this pull request Jul 11, 2024
sorascode pushed a commit to sorascode/godot-soras-version that referenced this pull request Jul 22, 2024
2nafish117 pushed a commit to 2nafish117/godot that referenced this pull request Aug 5, 2024
chryan pushed a commit to chryan/godot that referenced this pull request Aug 6, 2024
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.

Playing backwards discrete animation will begin with the first keyframe
3 participants