summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
Diffstat (limited to 'editor')
-rw-r--r--editor/plugins/node_3d_editor_plugin.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/editor/plugins/node_3d_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp
index 713837df44..b5a6698866 100644
--- a/editor/plugins/node_3d_editor_plugin.cpp
+++ b/editor/plugins/node_3d_editor_plugin.cpp
@@ -534,7 +534,10 @@ ObjectID Node3DEditorViewport::_select_ray(const Point2 &p_pos, bool p_append, b
}
if (dist < closest_dist) {
- item = edited_scene->get_deepest_editable_node(Object::cast_to<Node>(spat));
+ item = Object::cast_to<Node>(spat);
+ if (item != edited_scene) {
+ item = edited_scene->get_deepest_editable_node(item);
+ }
closest = item->get_instance_id();
closest_dist = dist;
@@ -693,7 +696,10 @@ void Node3DEditorViewport::_select_region() {
continue;
}
- Node *item = edited_scene->get_deepest_editable_node(Object::cast_to<Node>(sp));
+ Node *item = Object::cast_to<Node>(sp);
+ if (item != edited_scene) {
+ item = edited_scene->get_deepest_editable_node(item);
+ }
// Replace the node by the group if grouped
if (item->is_class("Node3D")) {