From 88a32c11f1d35c57a7af4b8f6733595b95ab4e4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20J=2E=20Est=C3=A9banez?= Date: Sat, 8 Oct 2016 20:37:05 +0200 Subject: [PATCH] Fix reparent undo not renaming back --- tools/editor/scene_tree_dock.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/editor/scene_tree_dock.cpp b/tools/editor/scene_tree_dock.cpp index 9c4e6415358..d69f1ac58fb 100644 --- a/tools/editor/scene_tree_dock.cpp +++ b/tools/editor/scene_tree_dock.cpp @@ -1109,6 +1109,7 @@ void SceneTreeDock::_do_reparent(Node* p_new_parent,int p_position_in_parent,Vec editor_data->get_undo_redo().create_action(TTR("Reparent Node")); List > path_renames; + Vector former_names; int inc=0; @@ -1118,6 +1119,7 @@ void SceneTreeDock::_do_reparent(Node* p_new_parent,int p_position_in_parent,Vec Node *node = p_nodes[ni]; fill_path_renames(node,new_parent,&path_renames); + former_names.push_back(node->get_name()); List owned; node->get_owned_by(node->get_owner(),&owned); @@ -1159,6 +1161,7 @@ void SceneTreeDock::_do_reparent(Node* p_new_parent,int p_position_in_parent,Vec editor_data->get_undo_redo().add_do_method(AnimationPlayerEditor::singleton->get_key_editor(),"set_root",node); editor_data->get_undo_redo().add_undo_method(new_parent,"remove_child",node); + editor_data->get_undo_redo().add_undo_method(node,"set_name",former_names[ni]); inc++;