Skip to content

Commit

Permalink
Merge pull request #69588 from TokageItLab/fix-play-bw
Browse files Browse the repository at this point in the history
Fix AnimationPlayer play backward doesn't process just current key & AnimationPlaybackTrack seeking for preview
  • Loading branch information
akien-mga committed Dec 5, 2022
2 parents e82d66f + 8c540b1 commit 777dca3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions editor/plugins/animation_player_editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,8 @@ void AnimationPlayerEditor::_play_from_pressed() {
player->stop(); //so it won't blend with itself
}
ERR_FAIL_COND_EDMSG(!_validate_tracks(player->get_animation(current)), "Animation tracks may have any invalid key, abort playing.");
player->play(current);
player->seek(time);
player->play(current);
}

//unstop
Expand Down Expand Up @@ -254,8 +254,8 @@ void AnimationPlayerEditor::_play_bw_from_pressed() {
player->stop(); //so it won't blend with itself
}
ERR_FAIL_COND_EDMSG(!_validate_tracks(player->get_animation(current)), "Animation tracks may have any invalid key, abort playing.");
player->play(current, -1, -1, true);
player->seek(time);
player->play(current, -1, -1, true);
}

//unstop
Expand Down
2 changes: 1 addition & 1 deletion scene/animation/animation_player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -955,7 +955,7 @@ void AnimationPlayer::_animation_process_animation(AnimationData *p_anim, double
break;
}

if (player->is_playing() || p_seeked) {
if (player->is_playing()) {
player->play(anim_name);
player->seek(at_anim_pos);
nc->animation_playing = true;
Expand Down

0 comments on commit 777dca3

Please sign in to comment.