Add option to toggle always showing collision shapes#99569
Conversation
9aa24b5 to
51b7957
Compare
|
I like the idea, but I'd say this would be better suited to the View menu at the top of the 3D editor viewport instead. This way, it'll persist on a per-scene basis and behave more like the other gizmo visibility options which are present in that menu. |
Personally I know I will probably never have this option enabled. So having to set it per scene would be tedious IMO. Especially when importing many meshes and viewing their scenes. But if that's the recommended way forward I can make that change as I'd rather have the option than none at all. |
|
So after exploring some I'm running into issues of how to connect that view menu setting to the gizmo logic. without access to the scene's state I can't look up that property. One solution I have found is adding a fourth option to the gizmo visibility selector: and then replace this check with the following: godot/editor/plugins/node_3d_editor_gizmos.cpp Line 1062 in 0c45ace ref->set_hidden(current_state == HIDDEN || (!ref->is_selected() && current_state == SELECTED));Thoughts on this vs the current PR in the Editor Settings/Editors/3d Gizmos/Gizmo Settings? |
|
Sorry was away on holiday, hopefully this is more clear. The issue I was running into regarding putting it in the view menu, is how to access that property. Since it is stored within the editstate file of the scene itself. I can't find a clean way of accessing as far as I can see the only route of communication between those settings is via godot/editor/plugins/node_3d_editor_gizmos.cpp Line 1046 in 893bbdf which is where the visibility selection is checked. Solution 1:Current PR, adding a new setting within Solution 2:adding a fourth option to the gizmo visiblity for only visible while selected (applies to all gizmos): godot/editor/plugins/node_3d_editor_gizmos.h Lines 153 to 156 in 893bbdf Solution 3:Exposing something akin to EDITOR_GET for the scenes edit state. or pulling the state with something like this: Node3DEditorViewport *vp = Node3DEditor::get_singleton()->get_last_used_viewport();
Dictionary d = vp->get_state();
if (d.has("always_show_collision_shapes")) {
show_collision_shapes_always = d["always_show_collision_shapes"];
}but this feels rather messy |
|
I think the option name is a bit unclear. "Always show", if you disable it, the shapes are going to show sometimes. When exactly? |
51b7957 to
751e6cc
Compare
Totally agree with this change. Rebased to efa1443 & made this change :) |
581e1fb to
239b7c9
Compare
Thanks! Fixed & pushed
|
|
Apologies for the delay, this was missed during the 4.5 release cycle and we're now reaching feature freeze again. Might be worth rebasing around that time (when 4.5 is released) so it's ready to merge. More reviews/discussions would be welcome in the meantime, there isn't much community engagement on the proposal to support the change so far. |
Repiteo
left a comment
There was a problem hiding this comment.
Looks good! Just needs a rebase, and this should be set!
|
Sorry, completely missed these comments. Rebased :) |
This comment was marked as resolved.
This comment was marked as resolved.
|
Thanks! |
Add option to toggle always showing collision shapes



closes godotengine/godot-proposals#11220
Currently even a simple scene can be visually distracting with a few collision shapes:
This PR adds a setting to only show collision shapes when the node is selected vs all the time.
This is with no object selected

With this PR:

