diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-07-26 12:44:50 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-26 12:44:50 +0200 |
commit | 5707c5d0ff67f3fa3a20ff7b30bdcd1f176b0f4b (patch) | |
tree | 672f4d0f8c5a11c40f48c21205d2fe6ff90b1953 | |
parent | a8fcfbf029b10bb861212ff8de4fb9f0062ed04c (diff) | |
parent | 32cb88b4103a10e01d845bbcebc1c01426a4cfcc (diff) |
Merge pull request #48620 from Calinou/editor-3d-hide-selection-box-no-gizmos
Hide the 3D editor selection box when View Gizmos is disabled
-rw-r--r-- | editor/plugins/node_3d_editor_plugin.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/editor/plugins/node_3d_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp index b69d57188c..6b6f5e7bc6 100644 --- a/editor/plugins/node_3d_editor_plugin.cpp +++ b/editor/plugins/node_3d_editor_plugin.cpp @@ -4822,7 +4822,9 @@ Object *Node3DEditor::_get_editor_data(Object *p_what) { RS::get_singleton()->instance_geometry_set_cast_shadows_setting( si->sbox_instance, RS::SHADOW_CASTING_SETTING_OFF); - RS::get_singleton()->instance_set_layer_mask(si->sbox_instance, 1 << Node3DEditorViewport::MISC_TOOL_LAYER); + // Use the Edit layer to hide the selection box when View Gizmos is disabled, since it is a bit distracting. + // It's still possible to approximately guess what is selected by looking at the manipulation gizmo position. + RS::get_singleton()->instance_set_layer_mask(si->sbox_instance, 1 << Node3DEditorViewport::GIZMO_EDIT_LAYER); RS::get_singleton()->instance_geometry_set_flag(si->sbox_instance, RS::INSTANCE_FLAG_IGNORE_OCCLUSION_CULLING, true); si->sbox_instance_xray = RenderingServer::get_singleton()->instance_create2( selection_box_xray->get_rid(), @@ -4830,7 +4832,9 @@ Object *Node3DEditor::_get_editor_data(Object *p_what) { RS::get_singleton()->instance_geometry_set_cast_shadows_setting( si->sbox_instance_xray, RS::SHADOW_CASTING_SETTING_OFF); - RS::get_singleton()->instance_set_layer_mask(si->sbox_instance_xray, 1 << Node3DEditorViewport::MISC_TOOL_LAYER); + // Use the Edit layer to hide the selection box when View Gizmos is disabled, since it is a bit distracting. + // It's still possible to approximately guess what is selected by looking at the manipulation gizmo position. + RS::get_singleton()->instance_set_layer_mask(si->sbox_instance_xray, 1 << Node3DEditorViewport::GIZMO_EDIT_LAYER); RS::get_singleton()->instance_geometry_set_flag(si->sbox_instance, RS::INSTANCE_FLAG_IGNORE_OCCLUSION_CULLING, true); return si; |