From 595de75641e0fae1f4e6924530da7a3308371a07 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Tue, 9 Feb 2016 16:30:50 -0300 Subject: [PATCH] -Allow renaming root node of inherited scene --- scene/resources/packed_scene.cpp | 2 +- tools/editor/scene_tree_editor.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scene/resources/packed_scene.cpp b/scene/resources/packed_scene.cpp index 43196a43d47..2377d220077 100644 --- a/scene/resources/packed_scene.cpp +++ b/scene/resources/packed_scene.cpp @@ -226,7 +226,7 @@ Node *SceneState::instance(bool p_gen_edit_state) const { node->add_to_group( snames[ n.groups[j] ], true ); } - if (n.instance>=0 || n.type!=TYPE_INSTANCED) { + if (n.instance>=0 || n.type!=TYPE_INSTANCED || i==0) { //if node was not part of instance, must set it's name, parenthood and ownership if (i>0) { if (parent) { diff --git a/tools/editor/scene_tree_editor.cpp b/tools/editor/scene_tree_editor.cpp index ba5cc7568b2..45eecacb6b0 100644 --- a/tools/editor/scene_tree_editor.cpp +++ b/tools/editor/scene_tree_editor.cpp @@ -230,7 +230,7 @@ void SceneTreeEditor::_add_nodes(Node *p_node,TreeItem *p_parent) { return; } } else { - part_of_subscene = get_scene_node()->get_scene_inherited_state().is_valid() && get_scene_node()->get_scene_inherited_state()->find_node_by_path(get_scene_node()->get_path_to(p_node))>=0; + part_of_subscene = p_node!=get_scene_node() && get_scene_node()->get_scene_inherited_state().is_valid() && get_scene_node()->get_scene_inherited_state()->find_node_by_path(get_scene_node()->get_path_to(p_node))>=0; } TreeItem *item = tree->create_item(p_parent);