Skip to content

Commit 594498e

Browse files
committed
Merge pull request #90966 from Calinou/debug-draw-use-runtime-colors
Use same colors for editor and running project for collision/path debug
2 parents ba6f840 + b1a2394 commit 594498e

12 files changed

+10
-14
lines changed

doc/classes/EditorSettings.xml

-3
Original file line numberDiff line numberDiff line change
@@ -393,9 +393,6 @@
393393
<member name="editors/3d_gizmos/gizmo_colors/joint" type="Color" setter="" getter="">
394394
The 3D editor gizmo color for [Joint3D]s and [PhysicalBone3D]s.
395395
</member>
396-
<member name="editors/3d_gizmos/gizmo_colors/shape" type="Color" setter="" getter="">
397-
The 3D editor gizmo color for [CollisionShape3D]s, [VehicleWheel3D]s, [RayCast3D]s and [SpringArm3D]s.
398-
</member>
399396
<member name="editors/animation/autorename_animation_tracks" type="bool" setter="" getter="">
400397
If [code]true[/code], automatically updates animation tracks' target paths when renaming or reparenting nodes in the Scene tree dock.
401398
</member>

editor/editor_settings.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -691,7 +691,6 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
691691
EDITOR_SETTING_USAGE(Variant::COLOR, PROPERTY_HINT_NONE, "editors/3d/selection_box_color", Color(1.0, 0.5, 0), "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED)
692692
EDITOR_SETTING_USAGE(Variant::COLOR, PROPERTY_HINT_NONE, "editors/3d_gizmos/gizmo_colors/instantiated", Color(0.7, 0.7, 0.7, 0.6), "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED)
693693
EDITOR_SETTING_USAGE(Variant::COLOR, PROPERTY_HINT_NONE, "editors/3d_gizmos/gizmo_colors/joint", Color(0.5, 0.8, 1), "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED)
694-
EDITOR_SETTING_USAGE(Variant::COLOR, PROPERTY_HINT_NONE, "editors/3d_gizmos/gizmo_colors/shape", Color(0.5, 0.7, 1), "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED)
695694
EDITOR_SETTING_USAGE(Variant::COLOR, PROPERTY_HINT_NONE, "editors/3d_gizmos/gizmo_colors/aabb", Color(0.28, 0.8, 0.82), "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED)
696695

697696
// If a line is a multiple of this, it uses the primary grid color.

editor/plugins/gizmos/collision_object_3d_gizmo_plugin.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
#include "scene/resources/surface_tool.h"
3939

4040
CollisionObject3DGizmoPlugin::CollisionObject3DGizmoPlugin() {
41-
const Color gizmo_color = EDITOR_GET("editors/3d_gizmos/gizmo_colors/shape");
41+
const Color gizmo_color = SceneTree::get_singleton()->get_debug_collisions_color();
4242
create_material("shape_material", gizmo_color);
4343
const float gizmo_value = gizmo_color.get_v();
4444
const Color gizmo_color_disabled = Color(gizmo_value, gizmo_value, gizmo_value, 0.65);

editor/plugins/gizmos/collision_polygon_3d_gizmo_plugin.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
#include "scene/3d/physics/collision_polygon_3d.h"
3636

3737
CollisionPolygon3DGizmoPlugin::CollisionPolygon3DGizmoPlugin() {
38-
const Color gizmo_color = EDITOR_GET("editors/3d_gizmos/gizmo_colors/shape");
38+
const Color gizmo_color = SceneTree::get_singleton()->get_debug_collisions_color();
3939
create_material("shape_material", gizmo_color);
4040
const float gizmo_value = gizmo_color.get_v();
4141
const Color gizmo_color_disabled = Color(gizmo_value, gizmo_value, gizmo_value, 0.65);

editor/plugins/gizmos/collision_shape_3d_gizmo_plugin.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949

5050
CollisionShape3DGizmoPlugin::CollisionShape3DGizmoPlugin() {
5151
helper.instantiate();
52-
const Color gizmo_color = EDITOR_GET("editors/3d_gizmos/gizmo_colors/shape");
52+
const Color gizmo_color = SceneTree::get_singleton()->get_debug_collisions_color();
5353
create_material("shape_material", gizmo_color);
5454
const float gizmo_value = gizmo_color.get_v();
5555
const Color gizmo_color_disabled = Color(gizmo_value, gizmo_value, gizmo_value, 0.65);

editor/plugins/gizmos/ray_cast_3d_gizmo_plugin.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
#include "scene/3d/physics/ray_cast_3d.h"
3636

3737
RayCast3DGizmoPlugin::RayCast3DGizmoPlugin() {
38-
const Color gizmo_color = EDITOR_GET("editors/3d_gizmos/gizmo_colors/shape");
38+
const Color gizmo_color = SceneTree::get_singleton()->get_debug_collisions_color();
3939
create_material("shape_material", gizmo_color);
4040
const float gizmo_value = gizmo_color.get_v();
4141
const Color gizmo_color_disabled = Color(gizmo_value, gizmo_value, gizmo_value, 0.65);

editor/plugins/gizmos/shape_cast_3d_gizmo_plugin.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
#include "scene/3d/physics/shape_cast_3d.h"
3636

3737
ShapeCast3DGizmoPlugin::ShapeCast3DGizmoPlugin() {
38-
const Color gizmo_color = EDITOR_GET("editors/3d_gizmos/gizmo_colors/shape");
38+
const Color gizmo_color = SceneTree::get_singleton()->get_debug_collisions_color();
3939
create_material("shape_material", gizmo_color);
4040
const float gizmo_value = gizmo_color.get_v();
4141
const Color gizmo_color_disabled = Color(gizmo_value, gizmo_value, gizmo_value, 0.65);

editor/plugins/gizmos/soft_body_3d_gizmo_plugin.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
#include "scene/3d/soft_body_3d.h"
3636

3737
SoftBody3DGizmoPlugin::SoftBody3DGizmoPlugin() {
38-
Color gizmo_color = EDITOR_GET("editors/3d_gizmos/gizmo_colors/shape");
38+
Color gizmo_color = SceneTree::get_singleton()->get_debug_collisions_color();
3939
create_material("shape_material", gizmo_color);
4040
create_handle_material("handles");
4141
}

editor/plugins/gizmos/spring_arm_3d_gizmo_plugin.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ void SpringArm3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) {
5252
}
5353

5454
SpringArm3DGizmoPlugin::SpringArm3DGizmoPlugin() {
55-
Color gizmo_color = EDITOR_GET("editors/3d_gizmos/gizmo_colors/shape");
55+
Color gizmo_color = SceneTree::get_singleton()->get_debug_collisions_color();
5656
create_material("shape_material", gizmo_color);
5757
}
5858

editor/plugins/gizmos/vehicle_body_3d_gizmo_plugin.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
#include "scene/3d/physics/vehicle_body_3d.h"
3636

3737
VehicleWheel3DGizmoPlugin::VehicleWheel3DGizmoPlugin() {
38-
Color gizmo_color = EDITOR_GET("editors/3d_gizmos/gizmo_colors/shape");
38+
Color gizmo_color = SceneTree::get_singleton()->get_debug_collisions_color();
3939
create_material("shape_material", gizmo_color);
4040
}
4141

editor/plugins/path_3d_editor_plugin.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1050,7 +1050,7 @@ int Path3DGizmoPlugin::get_priority() const {
10501050
}
10511051

10521052
Path3DGizmoPlugin::Path3DGizmoPlugin(float p_disk_size) {
1053-
Color path_color = EDITOR_DEF_RST("editors/3d_gizmos/gizmo_colors/path", Color(0.5, 0.5, 1.0, 0.9));
1053+
Color path_color = SceneTree::get_singleton()->get_debug_paths_color();
10541054
Color path_tilt_color = EDITOR_DEF_RST("editors/3d_gizmos/gizmo_colors/path_tilt", Color(1.0, 1.0, 0.4, 0.9));
10551055
disk_size = p_disk_size;
10561056

scene/2d/physics/collision_polygon_2d.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ void CollisionPolygon2D::_notification(int p_what) {
144144
}
145145
#endif
146146

147-
const Color stroke_color = Color(0.9, 0.2, 0.0);
147+
const Color stroke_color = get_tree()->get_debug_collisions_color();
148148
draw_polyline(polygon, stroke_color);
149149
// Draw the last segment.
150150
draw_line(polygon[polygon.size() - 1], polygon[0], stroke_color);

0 commit comments

Comments
 (0)