-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
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
Show visual-oriented 3D node gizmos only when selected #75303
Conversation
cf29497
to
d8fcdfe
Compare
Rebased and tested again, it works as expected. AudioStreamPlayer3D and GPUParticles3D are now also affected by this change. @WickedInsignia By the way, I wonder if this should apply to the Decal node gizmo as well. Being a purely visual element, it might get in the way if you have a lot of static decals placed in your scene. If we do that, there won't be any visual representation when not selected, but #81554 will address this (also for FogVolume, which also draws gizmo lines). |
5ca778e
to
b186629
Compare
Affected nodes: - DirectionalLight3D, OmniLight3D, SpotLight3D - ReflectionProbe - LightmapGI - VoxelGI - GPUParticles3D (but not collision/attractor nodes) - AudioStreamPlayer3D This reduces visual clutter in the editor with 3D scenes.
b186629
to
1024ba0
Compare
Haven't used the Decal node myself before but just gave it a play-around, and that could be optimal. The gizmo doesn't seem to be selectable and you need to use the Scene Outliner to select decals anyway, so there's no real loss in function if that's hidden. |
This is already available with View Gizmos in the Perspective menu, but it should be exposed with a more visible button (and a shortcut) indeed. This is a per-viewport setting, which means it can be changed independently of other viewports when you have more than one viewport visible. I guess it'd need a button located on the left of the Perspective menu. |
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.
I don't mind giving this a go, it looks reasonable.
const Ref<Material> lines_billboard_material = get_material("lines_billboard", p_gizmo); | ||
const Ref<Material> icon = get_material("light_omni_icon", p_gizmo); | ||
if (p_gizmo->is_selected()) { | ||
// Use both a billboard circle and 3 non-billboard circles for a better sphere-like representation |
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.
// Use both a billboard circle and 3 non-billboard circles for a better sphere-like representation | |
// Use both a billboard circle and 3 non-billboard circles for a better sphere-like representation. |
Vector<Vector3> points_billboard; | ||
|
||
for (int i = 0; i < 120; i++) { | ||
// Create a circle |
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.
// Create a circle | |
// Create a circle. |
const Point2 a = Vector2(Math::sin(ra), Math::cos(ra)) * r; | ||
const Point2 b = Vector2(Math::sin(rb), Math::cos(rb)) * r; | ||
|
||
// Draw axis-aligned circles |
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.
// Draw axis-aligned circles | |
// Draw axis-aligned circles. |
points.push_back(Vector3(a.x, a.y, 0)); | ||
points.push_back(Vector3(b.x, b.y, 0)); | ||
|
||
// Draw a billboarded circle |
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.
// Draw a billboarded circle | |
// Draw a billboarded circle. |
float d = r * Math::cos(Math::deg_to_rad(sl->get_param(Light3D::PARAM_SPOT_ANGLE))); | ||
|
||
for (int i = 0; i < 120; i++) { | ||
// Draw a circle |
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.
// Draw a circle | |
// Draw a circle. |
points_primary.push_back(Vector3(b.x, b.y, -d)); | ||
|
||
if (i % 15 == 0) { | ||
// Draw 8 lines from the cone origin to the sides of the circle |
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.
// Draw 8 lines from the cone origin to the sides of the circle | |
// Draw 8 lines from the cone origin to the sides of the circle. |
Thanks! I've decided to merge this despite the latest review comments because technically this PR didn't touch those lines, only changed the indentation. It would be good to have a consistency, but this is very minor. |
Is there any way to be able to see where the probes are placed now? |
Yes, as wireframe outlines are visible when the node is selected (along with gizmo icons for LightmapProbe nodes). |
Any chance this will be cherry-picked for 4.1.x? |
4.2 will be released in less than a month, possibly before a potential 4.1.3. If you want usability enhancements such as this one, I suggest testing the betas. |
After playing around with the Decal node some more I believe it would be best if the bounds are hidden when the node is not selected. The bounds become a mess of wires fairly quickly and I can't identify much use in referencing the bounds when deselected. It appears Unity and Unreal hide them when deselected as well. |
Affected nodes:
This reduces visual clutter in the editor with 3D scenes.
Note that when selecting multiple nodes, none of them is considered as selected for gizmo drawing. This is not a new issue, but it'll become more noticeable with this PR.
Use https://github.com/godotengine/godot/pull/75303/files?w=1 to review changes (ignore whitespace changes).
Before
After