-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Wrap mouse for blender-style transforms. #59467
Conversation
poke poke? |
Rebased to resolve conflicts, thanks for the reminder! |
This should be good for 4.2, I think, but it's too late for 4.1 at this point. Also, could you fix the style of the code comments that you've added. They all should start with a capital letter and end with a period. |
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. Code looks good to me too.
Updated the comments. Thanks for the reviews! |
I think you need to do a rebase to fix that issue with a test on CI. |
When performing a blender-style translate or scale (but not rotate), wrap the mouse inside the bounds of the viewport. This allows moving the mouse indefinitely for large translate or scale operations, and is consistent with how blender works. This enables global input processing during blender-style transforms, so we can capture and wrap mouse events outside the bounds of the viewport. Other wrapping operations use _sinput, which I assume is possible because a mouse button is held, so the control receives input even when the mouse exits the control. This does not implement wrapping for regular (gizmo-driven) transforms, though this could be done if desired. Fixes godotengine/godot-proposals#4255.
Sorry for this being quite a journey :) It looks good to go now, but we'll merge it a bit later, once we start merging 4.2-facing PRs. |
No worries, thanks for reviewing it! 4.2 sounds good. |
Thanks! |
This doesn't seem to work for me on my Mac; perhaps I am missing something? Although it's not shown in the recording, I did use both the regular gizmo and the Move Mode. Screen.Recording.2023-07-20.at.4.13.22.PM_1_1.mp4Godot 4.2.dev1.official, MacOS Monterey 12.6.7, Intel Core i7-4770HQ |
@aidan-j-rhoden are you using blender-style transforms (e.g. "Begin Translate Transformation")? This was implemented only for those, not gizmo-driven transforms, as noted in the commit:
|
I was not aware of blender-style transforms in Godot, only the gizmo transforms. So it seems that I missed the intended use. Sorry about that! If it's not too much trouble, however, do you think you could implement the mouse wrapping for the regular gizmo transforms too? I love that feature in Blender, as it makes the experience a lot smoother and easier to work with. Again, sorry about the misunderstanding, and thank you for your work and time! |
No worries! If I remember it would have been pretty simple to implement for both, I just wasn't sure if that was the desired behavior. I can take a look in a few days. |
When performing a blender-style translate or scale (but not rotate),
wrap the mouse inside the bounds of the viewport. This allows moving the
mouse indefinitely for large translate or scale operations, and is
consistent with how blender works.
This enables global input processing during blender-style transforms, so
we can capture and wrap mouse events outside the bounds of the viewport.
Other wrapping operations use _sinput, which I assume is possible
because a mouse button is held, so the control receives input even when
the mouse exits the control.
This does not implement wrapping for regular (gizmo-driven) transforms,
though this could be done if desired.
Fixes godotengine/godot-proposals#4255.
ssr-2022-03-24_08.24.10.mp4