Expose a way to set the color of Shape3D debug mesh#100328
Conversation
e1e20a1 to
f27a64d
Compare
|
This seems to have the same goal as PR #100317? |
|
It looks similar, however #100317 does not expose methods of |
|
Is there already consensus on moving forward with either this or #100317? The absence of |
|
Actually there is no "either", both PRs can be done. They each do different things but they are not conflicting (even though there might need to be some code merging). |
|
If you are interested, could you also update the following methods? godot/scene/2d/physics/collision_shape_2d.cpp Lines 232 to 235 in 89001f9 godot/scene/3d/physics/collision_shape_3d.cpp Lines 252 to 255 in 89001f9 const SceneTree *st = SceneTree::get_singleton();
return st ? st->get_debug_collisions_color() : GLOBAL_GET("debug/shapes/collision/shape_color"); |
f27a64d to
36cca5c
Compare
36cca5c to
59ece42
Compare
|
@dalexeev added. |
This allows scripts and extensions that don't use nodes to still obtain a colored mesh using get_debug_mesh, so they can keep drawing them when the debug option is enabled.
Since #90644, debug shapes of my voxel terrain plugin stopped showing. I found out it's because now
Shape3Dhas customizable colors, but they default to transparent black, which is invisible (I assume it is exploited to mean "null" in some places).Shape3D.get_debug_meshis where that color is used. So the only way to make it generate with the right color is to exposeset_debug_color. This is also the wayCollisionShape3Dnodes are working.An alternative would be to pass these options directly to
get_debug_mesh, but that would break compatibility.