1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-29 16:16:38 +00:00

Add an editor setting for the 3D selection box color

A restart is required to apply the setting change.
This commit is contained in:
Hugo Locurcio
2020-12-29 07:35:59 +01:00
parent 6cebb8c117
commit 8221037be0
2 changed files with 7 additions and 3 deletions

View File

@@ -4574,8 +4574,8 @@ void Node3DEditor::_generate_selection_boxes() {
Ref<StandardMaterial3D> mat = memnew(StandardMaterial3D);
mat->set_shading_mode(StandardMaterial3D::SHADING_MODE_UNSHADED);
// Use a similar color to the 2D editor selection.
mat->set_albedo(Color(1, 0.5, 0));
const Color selection_box_color = EDITOR_GET("editors/3d/selection_box_color");
mat->set_albedo(selection_box_color);
mat->set_transparency(StandardMaterial3D::TRANSPARENCY_ALPHA);
st->set_material(mat);
selection_box = st->commit();
@@ -4583,7 +4583,7 @@ void Node3DEditor::_generate_selection_boxes() {
Ref<StandardMaterial3D> mat_xray = memnew(StandardMaterial3D);
mat_xray->set_shading_mode(StandardMaterial3D::SHADING_MODE_UNSHADED);
mat_xray->set_flag(StandardMaterial3D::FLAG_DISABLE_DEPTH_TEST, true);
mat_xray->set_albedo(Color(1, 0.5, 0, 0.15));
mat_xray->set_albedo(selection_box_color * Color(1, 1, 1, 0.15));
mat_xray->set_transparency(StandardMaterial3D::TRANSPARENCY_ALPHA);
st_xray->set_material(mat_xray);
selection_box_xray = st_xray->commit();