Merge pull request #69932 from TokageItLab/animtrack-seek-order

Fix seeking process order to retrieve key correctly for AnimationTrack
This commit is contained in:
Rémi Verschelde 2022-12-11 22:55:46 +01:00 committed by GitHub
commit 9afcc364cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -956,8 +956,8 @@ void AnimationPlayer::_animation_process_animation(AnimationData *p_anim, double
} }
if (player->is_playing()) { if (player->is_playing()) {
player->play(anim_name);
player->seek(at_anim_pos); player->seek(at_anim_pos);
player->play(anim_name);
nc->animation_playing = true; nc->animation_playing = true;
playing_caches.insert(nc); playing_caches.insert(nc);
} else { } else {
@ -985,8 +985,8 @@ void AnimationPlayer::_animation_process_animation(AnimationData *p_anim, double
nc->animation_playing = false; nc->animation_playing = false;
} }
} else { } else {
player->seek(0.0);
player->play(anim_name); player->play(anim_name);
player->seek(0.0, true);
nc->animation_playing = true; nc->animation_playing = true;
playing_caches.insert(nc); playing_caches.insert(nc);
} }

View File

@ -1584,8 +1584,8 @@ void AnimationTree::_process_graph(double p_delta) {
} }
if (player2->is_playing() || seeked) { if (player2->is_playing() || seeked) {
player2->play(anim_name);
player2->seek(at_anim_pos); player2->seek(at_anim_pos);
player2->play(anim_name);
t->playing = true; t->playing = true;
playing_caches.insert(t); playing_caches.insert(t);
} else { } else {