From c09c60eb9c82cc45daf3337c68231eb4e9e4e8ed Mon Sep 17 00:00:00 2001 From: vaner-org Date: Mon, 2 Mar 2026 13:37:21 +0530 Subject: [PATCH] Add undo/redo to adding/removing StateMachine nodes --- editor/animation/animation_state_machine_editor.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/editor/animation/animation_state_machine_editor.cpp b/editor/animation/animation_state_machine_editor.cpp index f3c1508f11..ad96475b1b 100644 --- a/editor/animation/animation_state_machine_editor.cpp +++ b/editor/animation/animation_state_machine_editor.cpp @@ -971,6 +971,8 @@ void AnimationNodeStateMachineEditor::_add_menu_type(int p_index) { undo_redo->add_undo_method(state_machine.ptr(), "remove_node", name); connecting_to_node = name; _add_transition(true); + undo_redo->add_do_method(this, "_update_graph"); + undo_redo->add_undo_method(this, "_update_graph"); undo_redo->commit_action(); updating = false; @@ -998,6 +1000,8 @@ void AnimationNodeStateMachineEditor::_add_animation_type(int p_index) { undo_redo->add_undo_method(state_machine.ptr(), "remove_node", name); connecting_to_node = name; _add_transition(true); + undo_redo->add_do_method(this, "_update_graph"); + undo_redo->add_undo_method(this, "_update_graph"); undo_redo->commit_action(); updating = false;