Skip to content
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 ability to hide editor transform gizmo #87793

Merged

Conversation

ryevdokimov
Copy link
Contributor

@ryevdokimov ryevdokimov commented Jan 31, 2024

Related to: godotengine/godot-proposals#7834

There are scenarios where users want to be able to hide it, so this adds the option to.

Edit: The initial draft of this PR had the "View Gizmos" button toggle the visibility. Now it is a separate option.

2024-01-31.15-34-43.mp4

Collision gizmo without transform gizmo:

2024-01-31.16-01-04.mp4

@Mickeon
Copy link
Contributor

Mickeon commented Jan 31, 2024

Unsure if it should be hidden in the same toggle used by other gizmos, as it is arguably the most important gizmo, but it makes sense in theory.

@ryevdokimov
Copy link
Contributor Author

ryevdokimov commented Jan 31, 2024

I don't see why not. All the other Gizmos have their own toggle. I see this option as a literal "I don't want to see ANY gizmos button."

image

@AThousandShips
Copy link
Member

I'd say this is a different kind of gizmo, hence why it isn't in that list (unless I'm mistaken)

@ryevdokimov
Copy link
Contributor Author

ryevdokimov commented Jan 31, 2024

You're correct. It's not on the list, but neither is the selection box "gizmo?" and that is considered part of the "Show Gizmos" functionality. I suppose it all depends on the actual intended purpose of the button.

@AThousandShips
Copy link
Member

AThousandShips commented Jan 31, 2024

I think they are intended to always be shown, and are technically gizmos, but not in the same sense, for one they're used together with several other gizmos, though those other ones are largely mutually exclusive, as they're specific, while the transform and selection ones are generic, I think the toggle is to hide these specific ones, rather than the generic ones

I don't think this is an oversight, and I don't think it's any more distracting than the axis lines and grid etc.

@fire
Copy link
Member

fire commented Jan 31, 2024

I think it's a backwards compatibility change to use the same toggle. One way is to have a different toggle for it and rename the old one to mention its excludes certain gizmos within the small tooltip / label sizes.

@ryevdokimov
Copy link
Contributor Author

I think the toggle is to hide these specific ones, rather than the generic ones

If I'm understanding you correctly then hiding the selection box gizmo is a bug?

@AThousandShips
Copy link
Member

If I'm understanding you correctly then hiding the selection box gizmo is a bug?

Mt bad didn't know it was hidden, I'm not sure about that one, but I'd rather say that's a bug and not this part

@ryevdokimov
Copy link
Contributor Author

ryevdokimov commented Jan 31, 2024

I think it's a backwards compatibility change to use the same toggle. One way is to have a different toggle for it and rename the old one.

Fair enough, I can look into doing that. I'll just need to understand if this is combined with the selection box, or should the selection box never hide, or if it's a separate thing all together?

I personally do think there is a utility to allowing users to hide everything. Enable them to have a freelook preview camera basically.

@AThousandShips
Copy link
Member

Should be a separate setting as stated above, in that case, it breaks compatibility IMO

@ryevdokimov
Copy link
Contributor Author

I was talking about the selection box. Although I suppose that's a separate issue all together. I can just leave it alone for now, and just have a separate option for hiding the transform gizmo.

@AThousandShips
Copy link
Member

Meant for the hiding of this, I'd say to combine both sides of it

@ryevdokimov
Copy link
Contributor Author

Meant for the hiding of this, I'd say to combine both sides of it

I'll just open an issue for this and make a separate PR in the future, if that's fine.

@ryevdokimov ryevdokimov changed the title Hide Editor Transform Gizmo when View Gizmos is off Add ability to Hide Editor Transform Gizmo Jan 31, 2024
@ryevdokimov ryevdokimov marked this pull request as draft January 31, 2024 19:52
@ryevdokimov ryevdokimov marked this pull request as ready for review January 31, 2024 20:40
@ryevdokimov
Copy link
Contributor Author

ryevdokimov commented Jan 31, 2024

Ok, I made a separate option to toggle the transform gizmo. See attached video in the inital post.

@Aratch
Copy link

Aratch commented Feb 1, 2024

It's obviously not part of this PR, but will this option be eventually exposed to GdScript via EditorInterface?

@Mickeon
Copy link
Contributor

Mickeon commented Feb 1, 2024

I don't see why it should be. The best one could do without bloating EditorInterface is turn it into a action/shortcut, so that it can be at least triggered by other means.

@Aratch
Copy link

Aratch commented Feb 1, 2024

I don't see why it should be. The best one could do without bloating EditorInterface is turn it into a action/shortcut, so that it can be at least triggered by other means.

That's a fair assessment. I could open a proposal if necessary, but in short: when an EditorPlugin implements some sort of edit mode that relies on a node selection, it's AFAICT not possible to hide the editor's built-in gizmos, though you can turn off the default input behaviour (it's been a while since I've worked on something like this, admittedly).

@Mickeon
Copy link
Contributor

Mickeon commented Feb 1, 2024

No I understand, I personally experienced the same issue. Still, that sounds like it could be something extra to custom Node3DGizmos. Something like a _is_transform_gizmo_visible overridable method, so that it doesn't interfere with the setting but can still be customized.

Outside the scope of this PR, though. Could use a proposal indeed.

@Mickeon Mickeon requested review from fire and a team February 1, 2024 08:48
Copy link
Member

@fire fire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reviewed the video and it implements my request to move it to a separate boolean. Did not review the code.

Copy link
Member

@Calinou Calinou left a 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.

This makes sense to add, if only to support the scenario where you hold down F and look at an object while you're dragging it.

@akien-mga akien-mga changed the title Add ability to Hide Editor Transform Gizmo Add ability to hide editor transform gizmo Jun 25, 2024
@akien-mga akien-mga modified the milestones: 4.x, 4.4 Jun 25, 2024
@ryevdokimov ryevdokimov force-pushed the hide-transform-gizmo branch from be0c284 to c9e9bd4 Compare June 28, 2024 01:01
@akien-mga akien-mga merged commit 48645f3 into godotengine:master Aug 27, 2024
18 checks passed
@akien-mga
Copy link
Member

Thanks!

@ryevdokimov ryevdokimov deleted the hide-transform-gizmo branch August 27, 2024 23:05
ryevdokimov pushed a commit to Open-Industry-Project/godot that referenced this pull request Aug 29, 2024
…gizmo

Add ability to hide editor transform gizmo
ryevdokimov pushed a commit to Open-Industry-Project/godot that referenced this pull request Aug 31, 2024
…gizmo

Add ability to hide editor transform gizmo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't disable the 3D transform gizmo in the editor
7 participants