summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorneikeq <ignalfonsore@gmail.com>2015-11-23 20:06:37 +0100
committerneikeq <ignalfonsore@gmail.com>2015-11-23 20:22:42 +0100
commit62b9659c4164cdc9b80aa7f1ce83065efde1c025 (patch)
tree33d6dfa32baf6ebc2d8b91ac7192e9f2e89b5674 /tools
parentd3529da1e45c9dbbb10c7efbcd99d1ff525283f9 (diff)
Import Sub-Scene as root's child if no node is selected
Diffstat (limited to 'tools')
-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..