-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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 Animation Timeline Go to Next Step / Prev Step which triggered wrong animation display #83399
Fix Animation Timeline Go to Next Step / Prev Step which triggered wrong animation display #83399
Conversation
Please make the title shorter, describe what it fixes not how it is being fixed :) |
Are you asking why you yourself opened a pull request? |
I polished the descriptions, thanks |
I still can't make sense of what your title means |
I used the latest master build. When I used "Go to Next Step" or "Go to Previous Step" in the Animation Timeline Panel, the result is that the player seems to seek the wrong timeframe - i.e. wrong animation is displayed |
Perhaps the fundamental cause of this problem is related to #83197. However, looking at how the processing is done afterwards by this PR, it may be a fine fix, but it makes the Particular attention should be paid when testing to make sure that the audio track does not go haywire and that the animation playback track is properly sequenced. |
Upon your reminder I cross-checked the effect on audio animation track. I found another new issue when starting onion skinning while having put any audio into my animation track. The Godot commit I am using: [51f81e1] This newly found issue is independent of my fixes - I will open a new issue for this by today, I am yet to investigate it or look further into the corresponding onion skinning codes. cd.mp4Edit: new issue #83426 |
@TokageItLab regardless of my newly found issue, here is the polished fix by omitting all "p_drag" |
I'm not sure the signal should be changed, it breaks compatibility and risks causing problems |
I may revert the last commit to keep any backward compatibility albeit needing to keep "p_drag" intact. For those signal changes, I will scan for any potential risks / problems and list here FYI @AThousandShips |
015b2af
to
098d8f3
Compare
@AThousandShips I have removed the breaking codes for now. I will look more deeply and conclude a better code solution to fix it. |
No need to keep tagging me please :) it adds extra notifications and I'll still see the changes anyway |
…ng player->seek positions
098d8f3
to
84b44cd
Compare
OK, I just committed another approach that will also fix this issue. This approach should be less confusing. I tested with my mini-project fixed success, but I still need your verifications to see if it may break anything else. |
player->seek(pos, true, true); | ||
player->seek(pos + delta, true, true); |
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.
This particular line of code caused the animation display to jump elsewhere of the actual pos
, so I removed it.
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.
This change is equivalent to the following:
if (!p_timeline_only) {
if (player->is_valid() && !p_set) {
double delta = player->get_current_animation_position();
player->seek(pos, true, true);
player->seek(pos + delta, true, true);
} else {
if (player->is_playing()) {
player->stop();
}
player->seek(pos, true, true);
}
}
↓
if (!p_timeline_only) {
player->seek(pos, true, true);
}
I can't recall anymore why it was necessary in the past to handle drags and seek by key separately, but I think this change probably fine (you just need to rewrite the code as suggested, also p_set
argument should be removed if there is never problem). @SaracenOne Do you have any idea?
@@ -1262,9 +1262,7 @@ void AnimationPlayerEditor::_seek_value_changed(float p_value, bool p_set, bool | |||
|
|||
if (!p_timeline_only) { | |||
if (player->is_valid() && !p_set) { | |||
double delta = player->get_current_animation_position(); |
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.
This particular line of code is actually not returning a delta but rather the actual current position. It will make player->seek(pos + delta, true, true);
totally wrong. So I removed it as well.
Superseded by the linked PR. Thanks for your contribution nevertheless! Hope you can find something else for your first contribution 🙂 |
[FIX] Fix by unifying the behaviours of mouse / command key triggering player->seek: Animation Timeline Go to Next Step / Prev Step is triggering the wrong player->seek
This fix is to tackle with the issue:
Expected result: animation goes smoothly
issue_2_expected_result.mp4
Actual result: animation jumps crazily
issue_3_crazy_movement.mp4
issue_4_backforth.mp4
For details, please refer to this issue item:
I am not sure if my fix will break any other thing though (e.g. the most recent onion-skinning capability revival, AnimationMixer). I need you to help me verify.
This fix has the following related merges as the most recent ones:
#80813
#80939
Bugsquad Edited:
Fixes #85129