UI: Keymap Drag Direction Configuration #109726

Open
Lukas Sneyd wants to merge 11 commits from lcas/blender:keymap-drag-direction into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
First-time contributor

Configuration for keymap drag direction.


Can follow along by watching 9:56 of this youtube video about my custom build #109150

Blender let's you assign a direction to click-drag in the Keymap. There are 8 of them, which is nice, but it's confusing and inaccurate if all you need are 2. Provide some alternatives in Preferences->Input->Mouse. I'd like to put them at the top of the keymap in that preferences area, but I noticed how that thing will disappear if you load a keymap or use one other than the default. Didn't look into it yet.

Keymap Drag Direction has 3 options. Eight, which is what Blender does, Left Right, and Up Down. The tradeoff for the new ones is that they're exclusive. If you use Left Right, the only Keymap items Blender will match with are Any, Left, and Right. Unless something has been manually set to a direction, there shouldn't be anything besides View Axis, the ones where you hold ALT and Middlemouse while dragging in the direction that corresponds to the view you want.

image

With Blender's way, try to set Box select to Extend when dragging left aka West, and Subtract when dragging right aka East. If user doesn't initiate a mouse drag within 45 degrees of left or right, they get a Tweak Event instead of what they expected. There's a way to make this work better using the keymap alone. They can set Extend to Any, and Subtract to East, Northeast, and Southeast. The Keymap item set to Any needs to be after the other 3 or they'll be undetectable. Not intuitive, and I didn't figure out this was possible until after making this feature.

With the new ways I made there's 3 operators that will set drag direction. If a Keymap item is undetectable, it will warn the user about it. Not ideal, but nothing bad will happen, it's just telling them that this Keymap item won't do anything because Blender can't see it anymore.

Drag detection has some perpindicular bias. If the user is on the Left Right setting, and they drag up or down far enough before moving to the right, they're going to get the Left Keymap item instead of the Right Keymap item that they intended. If they're on Up Down, and move horizontally before going up, they would get the Down Keymap. With Blender's Eight way, assuming they set it like I described, the dominant Keymap item is the one that is set to the Any direction. The Left Right and Up down options are a lot more precise so it's hard for this to happen. The Eight way calculation rounds to the nearest int, so it treats every mouse drag within 45 degrees of a cardinal direction like it went straight vertical or horizontal. This problem can be mitigated by increasing drag theshold in Userprefs->Input->Mouse.

Configuration for keymap drag direction. --- Can follow along by watching 9:56 of this [youtube video](https://www.youtube.com/watch?v=HVrFCOa7RO8&t=596s) about my [custom build](https://blenderartists.org/t/blender-with-better-selection-and-more/1471220) #109150 Blender let's you assign a direction to click-drag in the Keymap. There are 8 of them, which is nice, but it's confusing and inaccurate if all you need are 2. Provide some alternatives in Preferences->Input->Mouse. I'd like to put them at the top of the keymap in that preferences area, but I noticed how that thing will disappear if you load a keymap or use one other than the default. Didn't look into it yet. Keymap Drag Direction has 3 options. Eight, which is what Blender does, Left Right, and Up Down. The tradeoff for the new ones is that they're exclusive. If you use Left Right, the only Keymap items Blender will match with are Any, Left, and Right. Unless something has been manually set to a direction, there shouldn't be anything besides View Axis, the ones where you hold ALT and Middlemouse while dragging in the direction that corresponds to the view you want. ![image](/attachments/98f72a50-1e2b-40d5-8422-9f3f29342a83) With Blender's way, try to set Box select to Extend when dragging left aka West, and Subtract when dragging right aka East. If user doesn't initiate a mouse drag within 45 degrees of left or right, they get a Tweak Event instead of what they expected. There's a way to make this work better using the keymap alone. They can set Extend to Any, and Subtract to East, Northeast, and Southeast. The Keymap item set to Any needs to be after the other 3 or they'll be undetectable. Not intuitive, and I didn't figure out this was possible until after making this feature. With the new ways I made there's 3 operators that will set drag direction. If a Keymap item is undetectable, it will warn the user about it. Not ideal, but nothing bad will happen, it's just telling them that this Keymap item won't do anything because Blender can't see it anymore. Drag detection has some perpindicular bias. If the user is on the Left Right setting, and they drag up or down far enough before moving to the right, they're going to get the Left Keymap item instead of the Right Keymap item that they intended. If they're on Up Down, and move horizontally before going up, they would get the Down Keymap. With Blender's Eight way, assuming they set it like I described, the dominant Keymap item is the one that is set to the Any direction. The Left Right and Up down options are a lot more precise so it's hard for this to happen. The Eight way calculation rounds to the nearest int, so it treats every mouse drag within 45 degrees of a cardinal direction like it went straight vertical or horizontal. This problem can be mitigated by increasing drag theshold in Userprefs->Input->Mouse.
Lukas Sneyd added 1 commit 2023-07-05 10:21:43 +02:00
Lukas Sneyd added 1 commit 2023-07-05 13:18:17 +02:00
Lukas Sneyd added 1 commit 2023-07-07 07:27:40 +02:00
Lukas Sneyd added 1 commit 2023-07-15 23:44:50 +02:00
Lukas Sneyd changed title from WIP: Keymap Drag Direction to Keymap Drag Direction 2023-07-15 23:49:05 +02:00
Author
First-time contributor

I was told to tag you guys. I don't know what I'm supposed to do, but I will try this. Thanks for your time
@ideasman42 @harley

I was told to tag you guys. I don't know what I'm supposed to do, but I will try this. Thanks for your time @ideasman42 @harley
Harley Acheson changed title from Keymap Drag Direction to UI: Keymap Drag Direction Configuration 2023-07-17 22:58:36 +02:00
Harley Acheson added this to the User Interface project 2023-07-17 23:00:25 +02:00
Lukas Sneyd added 1 commit 2023-07-23 15:33:07 +02:00
Lukas Sneyd added 1 commit 2023-07-23 15:34:40 +02:00
Lukas Sneyd added 1 commit 2023-07-23 15:47:44 +02:00
Lukas Sneyd added 1 commit 2023-08-01 10:13:23 +02:00
Lukas Sneyd added 1 commit 2023-08-06 08:59:08 +02:00
Lukas Sneyd added 1 commit 2023-08-13 10:03:34 +02:00
Lukas Sneyd added 1 commit 2023-08-21 06:33:20 +02:00
This pull request has changes conflicting with the target branch.
  • source/blender/makesdna/DNA_userdef_types.h

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u keymap-drag-direction:lcas-keymap-drag-direction
git checkout lcas-keymap-drag-direction
Sign in to join this conversation.
No reviewers
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
1 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#109726
No description provided.