[Bf-blender-cvs] [8333b681a78] master: Keymap: use "use_tweak_select_passthrough" preference for tweak tool

Campbell Barton noreply at git.blender.org
Tue Apr 5 04:31:52 CEST 2022


Commit: 8333b681a78cbed100891a63bbc689b0f4e4d4d0
Author: Campbell Barton
Date:   Tue Apr 5 12:29:34 2022 +1000
Branches: master
https://developer.blender.org/rB8333b681a78cbed100891a63bbc689b0f4e4d4d0

Keymap: use "use_tweak_select_passthrough" preference for tweak tool

This experimental preference was not making much difference with
selection set to left-mouse for the 3D view and UV editor. Now dragging
the existing selection is possible when this preference is enabled.

===================================================================

M	release/scripts/presets/keyconfig/keymap_data/blender_default.py

===================================================================

diff --git a/release/scripts/presets/keyconfig/keymap_data/blender_default.py b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
index 2f148c174b0..2c30859a2f3 100644
--- a/release/scripts/presets/keyconfig/keymap_data/blender_default.py
+++ b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
@@ -457,7 +457,36 @@ def _template_items_change_frame(params):
 
 # Tool System Templates
 
-def _template_items_tool_select(params, operator, cursor_operator, *, cursor_prioritize=False, fallback=False):
+def _template_items_tool_select(
+        params, operator, cursor_operator, *,
+        # Always use the cursor operator where possible,
+        # needed for time-line views where we always want to be able to scrub time.
+        cursor_prioritize=False,
+        fallback=False,
+):
+    if not params.legacy and not fallback:
+        # Experimental support for LMB interaction for the tweak tool. see: T96544.
+        # NOTE: For RMB-select this is a much bigger change as it disables 3D cursor placement on LMB.
+        # For LMB-select this means an LMB -drag will not first de-select all (similar to node/graph editor).
+        select_passthrough = False
+        if params.select_mouse == 'LEFTMOUSE':
+            select_passthrough = params.use_tweak_select_passthrough
+        else:
+            if not cursor_prioritize:
+                select_passthrough = params.use_tweak_tool_lmb_interaction
+
+        if select_passthrough:
+            return [
+                (operator, {"type": 'LEFTMOUSE', "value": 'PRESS'},
+                 {"properties": [("deselect_all", True), ("select_passthrough", True)]}),
+                (operator, {"type": 'LEFTMOUSE', "value": 'CLICK'},
+                 {"properties": [("deselect_all", True)]}),
+                (operator, {"type": 'LEFTMOUSE', "value": 'PRESS', "shift": True},
+                 {"properties": [("deselect_all", False), ("toggle", True)]}),
+                ("transform.translate", {"type": 'LEFTMOUSE', "value": 'CLICK_DRAG'},
+                 {"properties": [("release_confirm", True)]}),
+            ]
+
     if params.select_mouse == 'LEFTMOUSE':
         # By default use 'PRESS' for immediate select without quick delay.
         # Fallback key-maps 'CLICK' since 'PRESS' events passes through (allowing either click or drag).
@@ -479,19 +508,6 @@ def _template_items_tool_select(params, operator, cursor_operator, *, cursor_pri
             ))
         ]
     else:
-        # Experimental support for LMB interaction for the tweak tool.
-        if params.use_tweak_tool_lmb_interaction and (not cursor_prioritize) and (not fallback):
-            return [
-                (operator, {"type": 'LEFTMOUSE', "value": 'PRESS'},
-                 {"properties": [("deselect_all", True), ("select_passthrough", True)]}),
-                (operator, {"type": 'LEFTMOUSE', "value": 'CLICK'},
-                 {"properties": [("deselect_all", True)]}),
-                (operator, {"type": 'LEFTMOUSE', "value": 'PRESS', "shift": True},
-                 {"properties": [("deselect_all", False), ("toggle", True)]}),
-                ("transform.translate", {"type": 'LEFTMOUSE', "value": 'CLICK_DRAG'},
-                 {"properties": [("release_confirm", True)]}),
-            ]
-
         # For right mouse, set the cursor.
         return [
             (cursor_operator, {"type": 'LEFTMOUSE', "value": 'PRESS'}, None),



More information about the Bf-blender-cvs mailing list