diff options
author | mostafahassan <habib_musse@hotmail.com> | 2015-03-31 20:26:38 +0200 |
---|---|---|
committer | mostafahassan <habib_musse@hotmail.com> | 2015-03-31 20:26:38 +0200 |
commit | 3d4cc27bad8fe05f38488c52ef6bb4c846993209 (patch) | |
tree | 895a61b5685cf0c00bf44225b690148912a4d2c0 | |
parent | 7f8a0cddcfbd5744113de1826380310ad920360a (diff) |
New node will be added to root node if nothing is selected
-rw-r--r-- | tools/editor/scene_tree_dock.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/tools/editor/scene_tree_dock.cpp b/tools/editor/scene_tree_dock.cpp index 2012d96664..84b34cf130 100644 --- a/tools/editor/scene_tree_dock.cpp +++ b/tools/editor/scene_tree_dock.cpp @@ -1059,14 +1059,15 @@ void SceneTreeDock::_create() { if (edited_scene) { - + // If root exists in edited scene parent = scene_tree->get_selected(); - ERR_FAIL_COND(!parent); - } else { + if( !parent ) + parent = edited_scene; + } else { + // If no root exist in edited scene parent = scene_root; ERR_FAIL_COND(!parent); - } Object *c = create_dialog->instance_selected(); |