summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémi Verschelde <remi@verschelde.fr>2015-11-23 20:27:51 +0100
committerRémi Verschelde <remi@verschelde.fr>2015-11-23 20:27:51 +0100
commit17a97b7bdfbf556e218103d476c3e31a4f1c0be7 (patch)
treea9164a248998b2a9b3fe539ad20e5a461fdee5dd
parent19a8f9b74d9ef7a4e2e9f5b1d1333995e2384943 (diff)
parent62b9659c4164cdc9b80aa7f1ce83065efde1c025 (diff)
Merge pull request #2894 from neikeq/import_subscene_patch
Import Sub-Scene as root's child if no node is selected
-rw-r--r--tools/editor/scene_tree_dock.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/editor/scene_tree_dock.cpp b/tools/editor/scene_tree_dock.cpp
index 0cafe7459b..8b5bf8c1e1 100644
--- a/tools/editor/scene_tree_dock.cpp
+++ b/tools/editor/scene_tree_dock.cpp
@@ -1264,7 +1264,10 @@ void SceneTreeDock::import_subscene() {
void SceneTreeDock::_import_subscene() {
Node* parent = scene_tree->get_selected();
- ERR_FAIL_COND(!parent);
+ if (!parent) {
+ parent = editor_data->get_edited_scene_root();
+ ERR_FAIL_COND(!parent);
+ }
import_subscene_dialog->move(parent,edited_scene);
editor_data->get_undo_redo().clear_history(); //no undo for now..