diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2024-09-19 17:13:16 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2024-09-19 17:13:16 +0200 |
commit | ff334cd1dd31d15987acafc06ea941b76d8384f7 (patch) | |
tree | 0efadb5f2fd98490eff22616967b57eef32f1a94 | |
parent | a05e06f9cf81e313781c6bb238ef89bd1f085bc1 (diff) | |
parent | 5aa8f8dfeec657afb967a6f9c5fe8a8dbd0d1fbe (diff) | |
download | redot-engine-ff334cd1dd31d15987acafc06ea941b76d8384f7.tar.gz |
Merge pull request #97169 from Dowsley/fix/undo-redo-bezier-anim-editor
Fix Undo/Redo not working in Bezier Animation Editor when moving keys
-rw-r--r-- | editor/animation_bezier_editor.cpp | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/editor/animation_bezier_editor.cpp b/editor/animation_bezier_editor.cpp index 66ebd07c2a..2e8c727849 100644 --- a/editor/animation_bezier_editor.cpp +++ b/editor/animation_bezier_editor.cpp @@ -1443,6 +1443,11 @@ void AnimationBezierTrackEdit::gui_input(const Ref<InputEvent> &p_event) { i++; } + AnimationPlayerEditor *ape = AnimationPlayerEditor::get_singleton(); + if (ape) { + undo_redo->add_do_method(ape, "_animation_update_key_frame"); + undo_redo->add_undo_method(ape, "_animation_update_key_frame"); + } undo_redo->commit_action(); } else if (select_single_attempt != IntPair(-1, -1)) { @@ -1967,15 +1972,6 @@ void AnimationBezierTrackEdit::delete_selection() { void AnimationBezierTrackEdit::_bezier_track_insert_key_at_anim(const Ref<Animation> &p_anim, int p_track, double p_time, real_t p_value, const Vector2 &p_in_handle, const Vector2 &p_out_handle, const Animation::HandleMode p_handle_mode) { int idx = p_anim->bezier_track_insert_key(p_track, p_time, p_value, p_in_handle, p_out_handle); p_anim->bezier_track_set_key_handle_mode(p_track, idx, p_handle_mode); - - EditorUndoRedoManager *undo_redo = EditorUndoRedoManager::get_singleton(); - undo_redo->create_action(TTR("Animation Bezier Curve Change Call")); - AnimationPlayerEditor *ape = AnimationPlayerEditor::get_singleton(); - if (ape) { - undo_redo->add_do_method(ape, "_animation_update_key_frame"); - undo_redo->add_undo_method(ape, "_animation_update_key_frame"); - } - undo_redo->commit_action(); } void AnimationBezierTrackEdit::_bind_methods() { |