summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRémi Verschelde <remi@verschelde.fr>2021-12-06 18:26:45 +0100
committerGitHub <noreply@github.com>2021-12-06 18:26:45 +0100
commit586c1997896fcdbb1c92d488425d7f4b4659b76d (patch)
tree99e6cc1b1c9d20bf68bc74eb161b0255b96dc61e
parente11baf90d1cf9e178eabfd259ea1daaf0a9df882 (diff)
parentb7d83689e4ff887e1450df723bc9def6cccae6de (diff)
downloadredot-engine-586c1997896fcdbb1c92d488425d7f4b4659b76d.tar.gz
Merge pull request #55671 from KoBeWi/hotfix_straight_from_a_🌋
-rw-r--r--editor/animation_track_editor.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/editor/animation_track_editor.cpp b/editor/animation_track_editor.cpp
index 51d3eca149..804e9b38c3 100644
--- a/editor/animation_track_editor.cpp
+++ b/editor/animation_track_editor.cpp
@@ -5756,6 +5756,7 @@ void AnimationTrackEditor::_edit_menu_pressed(int p_option) {
}
}
+ int existing_idx = -1;
if (dst_track == -1) {
// If adding multiple tracks, make sure that correct track is referenced.
dst_track = reset_tracks;
@@ -5764,10 +5765,10 @@ void AnimationTrackEditor::_edit_menu_pressed(int p_option) {
undo_redo->add_do_method(reset.ptr(), "add_track", animation->track_get_type(sk.track));
undo_redo->add_do_method(reset.ptr(), "track_set_path", dst_track, path);
undo_redo->add_undo_method(reset.ptr(), "remove_track", dst_track);
+ } else {
+ existing_idx = reset->track_find_key(dst_track, 0, true);
}
- int existing_idx = reset->track_find_key(dst_track, 0, true);
-
undo_redo->add_do_method(reset.ptr(), "track_insert_key", dst_track, 0, animation->track_get_key_value(sk.track, sk.key), animation->track_get_key_transition(sk.track, sk.key));
undo_redo->add_undo_method(reset.ptr(), "track_remove_key_at_time", dst_track, 0);