Skip to content

Commit

Permalink
Copy track update mode when adding reset key
Browse files Browse the repository at this point in the history
  • Loading branch information
KoBeWi committed Dec 30, 2023
1 parent 13a0d6e commit d96fca3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions editor/animation_track_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6038,6 +6038,12 @@ void AnimationTrackEditor::_edit_menu_pressed(int p_option) {
existing_idx = reset->track_find_key(dst_track, 0, Animation::FIND_MODE_APPROX);
}

if (animation->track_get_type(sk.track) == Animation::TYPE_VALUE) {
undo_redo->add_do_method(reset.ptr(), "value_track_set_update_mode", dst_track, animation->value_track_get_update_mode(sk.track));
undo_redo->add_do_method(reset.ptr(), "track_set_interpolation_type", dst_track, animation->track_get_interpolation_type(sk.track));
undo_redo->add_do_method(reset.ptr(), "track_set_interpolation_loop_wrap", dst_track, animation->track_get_interpolation_loop_wrap(sk.track));
}

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);

Expand Down

0 comments on commit d96fca3

Please sign in to comment.