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

Make 3D transforms done inside editor viewport, but w/o grabbing a gizmo handle require pressing alt #87756

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ryevdokimov
Copy link
Contributor

@ryevdokimov ryevdokimov commented Jan 30, 2024

Implements: godotengine/godot-proposals#9007

Would fix: #87608

This a proof of concept, but ready to be tested.

It would also make basically all tools work like "Select Mode", which would probably need to be renamed, and is therefore also an extension of #86804

Example:

2024-01-30.16-38-19.mp4

@ratkingsminion
Copy link

ratkingsminion commented Feb 3, 2024

I'm not sure if this is some on my side, but with this PR I have the following behaviour (when having a 3D object selected and dragging the cursor (LMB) over another object, and not being near the gizmo):

Select Mode: Selected object gets translated in viewport space
Select Mode, with Alt pressed: Nothing

Move Mode: Selected object gets translated in viewport space
Move Mode, with Alt pressed: The same

Rotate Mode: Selected object gets translated(!) in viewport space
Rotate Mode, with Alt pressed: Selected object gets rotated in viewport space

Scale Mode: Selected object gets translated(!) in viewport space
Scale Mode, with Alt pressed: Selected object gets scaled (local space)

What I would have expected:

Select Mode: Nothing
Select Mode, with Alt pressed: Selected object gets translated in viewport space

Move Mode: Nothing
Move Mode, with Alt pressed: Selected object gets translated in viewport space

Rotate Mode: Nothing
Rotate Mode, with Alt pressed: Selected object gets rotated in viewport space

Scale Mode: Nothing
Scale Mode, with Alt pressed: Selected object gets scaled (local space)

Interesting enough when I do Alt+RMB, the other objects gets selected.

@ryevdokimov
Copy link
Contributor Author

I just pushed a change that should resolve that. It looks like even in 4.2 stable in select mode when you drag over some kind of geometry it will translate the node(s), which I don't fully understand why that would be the case. The changes I just made make it so it always defaults to region select.

@ratkingsminion
Copy link

ratkingsminion commented Feb 4, 2024

Indeed, now everything behaves like I'd expect it to, at least in my limited test scene. Thanks!

@ryevdokimov
Copy link
Contributor Author

ryevdokimov commented Feb 4, 2024

Good to hear. Assuming there isn't any more bugs, the only thing left to finish this draft is to update the tooltips, but I'm not sure that's worth doing unless this gets more traction and because of a potential issue I found related to the tooltips: #87924

@AThousandShips
Copy link
Member

For future reference I'd suggest just rebasing your branches on top of some other fix if you want to include it, makes it much easier to rebase after the other PR has been merged, now you need to potentially handle merge conflicts

@ryevdokimov
Copy link
Contributor Author

My heart is in the right place, but you're always there to make it right. Thanks again.

@@ -668,7 +668,7 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
// 3D: Navigation
_initial_set("editors/3d/navigation/invert_x_axis", false);
_initial_set("editors/3d/navigation/invert_y_axis", false);
EDITOR_SETTING(Variant::INT, PROPERTY_HINT_ENUM, "editors/3d/navigation/navigation_scheme", 0, "Godot,Maya,Modo")
EDITOR_SETTING(Variant::INT, PROPERTY_HINT_ENUM, "editors/3d/navigation/navigation_scheme", 0, "Godot,Maya,Modo,Temp")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't know what I would call this.

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.

Involuntary object transformations, due to freeform mouse drag handling in viewport
3 participants