Transform: Use alternative hotkeys for Zoom and Rotate #109754

Merged
Germano Cavalcante merged 1 commits from mano-wii/blender:navigation_tests into main 2023-07-24 15:52:05 +02:00

In order to avoid navigation hotkey conflicts during transform
operations, this commit implements the "Transform Navigation with Alt"
option.

This option is enabled by default and makes navigation hotkeys require
the Alt key during a transforming in the 3D View.

The hotkeys changed (only during transformations) are:

  • Zoom View - Alt + Mouse Scroll
  • Rotate View - Alt + MMB
  • Pan View - Alt + MMB

image

Builds:
https://builder.blender.org/download/patch/PR109754/

In order to avoid navigation hotkey conflicts during transform operations, this commit implements the "Transform Navigation with Alt" option. This option is enabled by default and makes navigation hotkeys require the `Alt` key during a transforming in the 3D View. The hotkeys changed (only during transformations) are: - Zoom View - `Alt` + `Mouse Scroll` - Rotate View - `Alt` + `MMB` - Pan View - `Alt` + `MMB` --- ![image](/attachments/3ef4b291-8fab-4688-81ab-e316178d93db) **Builds:** https://builder.blender.org/download/patch/PR109754/
Author
Member

@blender-bot package

@blender-bot package
Member

Package build started. Download here when ready.

Package build started. [Download here](https://builder.blender.org/download/patch/PR109754) when ready.
Germano Cavalcante requested review from Brecht Van Lommel 2023-07-05 18:24:45 +02:00
Germano Cavalcante requested review from Dalai Felinto 2023-07-05 18:24:45 +02:00
Germano Cavalcante requested review from Julien Kaspar 2023-07-05 18:24:45 +02:00
Dalai Felinto approved these changes 2023-07-06 12:50:04 +02:00
Dalai Felinto left a comment
Owner

This seems to be working surprisingly well.

Even for "Emulate Mouse Button", where I don't mind using MMB exceptionally when transforming, while can still avoid it elsewhere (by using Alt).

This seems to be working surprisingly well. Even for "Emulate Mouse Button", where I don't mind using MMB exceptionally when transforming, while can still avoid it elsewhere (by using Alt).
First-time contributor

Pan for Alt + Shift + MMB also seems working well (Linux Mint).
The concept level feels doubtable (hard to switch between several navigations, but for misc operations may be affordable).
Technical level works very smooth (object/edit modes, Grab, Rotate, Scale, Extrude, Duplicate).

Pan for `Alt` + `Shift` + `MMB` also seems working well (Linux Mint). The concept level feels doubtable (hard to switch between several navigations, but for misc operations may be affordable). Technical level works very smooth (object/edit modes, Grab, Rotate, Scale, Extrude, Duplicate).
Member

I agree that this works surprisingly well. The downside is that it won't be accessible to anyone who don't have a middle mouse button.

Also I'd like this to not be hardcoded but be exposed in the 'Transform Modal Map' in the keymap editor, just like any other shortcut of the transform modal operations.
Then it will show up in the status bar and can get changed in the preferences if needed.

I agree that this works surprisingly well. The downside is that it won't be accessible to anyone who don't have a middle mouse button. Also I'd like this to not be hardcoded but be exposed in the 'Transform Modal Map' in the keymap editor, just like any other shortcut of the transform modal operations. Then it will show up in the status bar and can get changed in the preferences if needed.

Trackpads for navigation during should just work without any modifier. And that covers the case for people without MMB, no? But I'm not sure whether trackpad is working in this case.

Trackpads for navigation during should just work without any modifier. And that covers the case for people without MMB, no? But I'm not sure whether trackpad is working in this case.
Member

That's a good point! I'd like to test this on my laptop tomorrow.
Or if someone else can beat me to it :D

That's a good point! I'd like to test this on my laptop tomorrow. Or if someone else can beat me to it :D
Germano Cavalcante changed title from WIP: Transform: Always allow navigation: Alternative Zoom and Rotate shortcuts to WIP: Transform: Always allow navigation and use alternative hotkeys for Zoom and Rotate 2023-07-07 15:16:04 +02:00
Germano Cavalcante force-pushed navigation_tests from cb7d77d4f6 to 4560b735cd 2023-07-10 21:51:35 +02:00 Compare
Germano Cavalcante changed title from WIP: Transform: Always allow navigation and use alternative hotkeys for Zoom and Rotate to Transform: Use alternative hotkeys for Zoom and Rotate 2023-07-10 21:52:01 +02:00
Author
Member

Updates:

  • The option (enabled by default) "Transform Navigation with Alt" has been added to the keymap options.
  • If this option is disabled, the Proportional Influence, Automatic Constraints and Auto IK Chain Length transform modifiers will require Alt instead.
  • It is also important to note that this option does not check existing keyitems that may have been modified by the user. So for custom keymaps, the behavior can be a bit unpredictable.

Solution in code:

  • A blender::Vector member has been added to ViewOpsData to track all keyitems used for navigation.
  • The const bool use_alt_navigation option has been added to the ED_view3d_navigation_init so that it alters the keymaps tracked by ViewOpsData by simply adding the Alt modifier to them.
Updates: - The option (enabled by default) "Transform Navigation with Alt" has been added to the keymap options. - If this option is disabled, the Proportional Influence, Automatic Constraints and Auto IK Chain Length transform modifiers will require `Alt` instead. - It is also important to note that this option does not check existing keyitems that may have been modified by the user. So for custom keymaps, the behavior can be a bit unpredictable. Solution in code: - A `blender::Vector` member has been added to `ViewOpsData` to track all keyitems used for navigation. - The `const bool use_alt_navigation` option has been added to the `ED_view3d_navigation_init` so that it alters the keymaps tracked by `ViewOpsData` by simply adding the `Alt` modifier to them.
Author
Member

@blender-bot package

@blender-bot package
Member

Package build started. Download here when ready.

Package build started. [Download here](https://builder.blender.org/download/patch/PR109754) when ready.
First-time contributor

Windows build was not updated, so tested on Linux.
For the default keymap it seems to work well, the way switching the checkbox switches the navigation style is pretty stable.
For 2.7 keymap it is overriding with no option though.

Windows build was not updated, so tested on Linux. For the default keymap it seems to work well, the way switching the checkbox switches the navigation style is pretty stable. For 2.7 keymap it is overriding with no option though.
Member

Sorry for the delay. I've finally tried this with the trackpad and found it to work even better than with a mouse.
The main reason for that is that the transform gets reset during the navigation instead of after.
This live updating prevents the transformed element from jumping around visually.
That's something we should try for the mouse navigation as well.

Sorry for the delay. I've finally tried this with the trackpad and found it to work even better than with a mouse. The main reason for that is that the transform gets reset during the navigation instead of after. This live updating prevents the transformed element from jumping around visually. That's something we should try for the mouse navigation as well.
Julien Kaspar approved these changes 2023-07-13 09:23:43 +02:00
Julien Kaspar left a comment
Member

The changes of this PR are all good to me.

The changes of this PR are all good to me.

"That's something we should try for the mouse navigation as well."

Agreed, I even thought Julien would wait for this update before approving the patch. Anyways I think this is a must. I hope you can try implement that as well @mano-wii

"That's something we should try for the mouse navigation as well." Agreed, I even thought Julien would wait for this update before approving the patch. Anyways I think this is a must. I hope you can try implement that as well @mano-wii
Member

@dfelinto I thought this can be done via the next PR. Probably #109451

@dfelinto I thought this can be done via the next PR. Probably #109451
Germano Cavalcante force-pushed navigation_tests from 4560b735cd to e2078da340 2023-07-13 19:42:02 +02:00 Compare
Author
Member

Updated the code and fixed the issue with 2.7 keymap where navigation without Alt was being enabled without option.
Now Alt navigation is enabled for keymap 2.7 (still no option).

I changed the solution in code. It didn't seem safe to make shallow copies of keyitems in order to change modifiers. So now an internal wmKeyMap has been created where the wmKeyMapItem items are copied and modified.

Also to avoid changing the size of the struct used by navigation operators, a derived struct ViewOpsData_Utility was created and used only by the ED_view3d_navigation_do utility.

@blender-bot package

Updated the code and fixed the issue with 2.7 keymap where navigation **without** `Alt` was being enabled without option. Now `Alt` navigation is enabled for keymap 2.7 (still no option). I changed the solution in code. It didn't seem safe to make shallow copies of keyitems in order to change modifiers. So now an internal `wmKeyMap` has been created where the `wmKeyMapItem` items are copied and modified. Also to avoid changing the size of the struct used by navigation operators, a derived struct `ViewOpsData_Utility` was created and used only by the `ED_view3d_navigation_do` utility. @blender-bot package
Member

Package build started. Download here when ready.

Package build started. [Download here](https://builder.blender.org/download/patch/PR109754) when ready.
First-time contributor

I agree that Alt solution could be a better choice for 2.7 keymap since that navigation style was designed to bring the least amount of interference.

It is also interesting that Alt navigation style is technically compatible with using gizmos axis restriction.
For sure it assumes 4-buttons simultaneous pressholding where 2 of them belong to the mouse during pan, but it is an inevitable concept level limitation - this is why, for example, the use of gizmos is usually avoided during precise CADwork where transform operations are supposed to have lots of different simultaneous restrictions.
But the technical possibility and compatibility is mentionable and interesting.

I agree that `Alt` solution could be a better choice for 2.7 keymap since that navigation style was designed to bring the least amount of interference. It is also interesting that `Alt` navigation style is technically compatible with using gizmos axis restriction. For sure it assumes 4-buttons simultaneous pressholding where 2 of them belong to the mouse during pan, but it is an inevitable concept level limitation - this is why, for example, the use of gizmos is usually avoided during precise CADwork where transform operations are supposed to have lots of different simultaneous restrictions. But the technical possibility and compatibility is mentionable and interesting.
Germano Cavalcante force-pushed navigation_tests from e2078da340 to b7d86d2ac2 2023-07-24 15:49:54 +02:00 Compare
Germano Cavalcante merged commit 017d4912b2 into main 2023-07-24 15:52:05 +02:00
Germano Cavalcante deleted branch navigation_tests 2023-07-24 15:52:06 +02:00
First-time contributor

Having disabled the need to ALT in the individual transform keymap items (2.7) in 4.0, I'm now faced with no ability to do this 4.1 anymore. Wondering if it will stay like this or is there more work to be done?

Having disabled the need to ALT in the individual transform keymap items (2.7) in 4.0, I'm now faced with no ability to do this 4.1 anymore. Wondering if it will stay like this or is there more work to be done?
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
6 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#109754
No description provided.