-
-
Notifications
You must be signed in to change notification settings - Fork 22k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add option to toggle always showing collision shapes #99569
base: master
Are you sure you want to change the base?
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
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested locally, it works as expected.
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:

