-Allow renaming root node of inherited scene

This commit is contained in:
Juan Linietsky 2016-02-09 16:30:50 -03:00
parent f51c26c025
commit 595de75641
2 changed files with 2 additions and 2 deletions

View file

@ -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) {

View file

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