[Bf-blender-cvs] [f2b9bbd1942] master: Fix T97032: Tweak Select preference causes selection issues

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


Commit: f2b9bbd1942ee37ba7fbd38146751253114a4030
Author: Campbell Barton
Date:   Tue Apr 5 12:29:29 2022 +1000
Branches: master
https://developer.blender.org/rBf2b9bbd1942ee37ba7fbd38146751253114a4030

Fix T97032: Tweak Select preference causes selection issues

Disable select-passthrough on release events.

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

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 6bdbc60471f..d29c7562d3d 100644
--- a/release/scripts/presets/keyconfig/keymap_data/blender_default.py
+++ b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
@@ -31,6 +31,12 @@ class Params:
         "context_menu_event",
         "cursor_set_event",
         "cursor_tweak_event",
+        # NOTE: this is intended to be used so pressing a button can then drag the current selection.
+        # This should not be used for button release values such as `CLICK` or `RELEASE` which should
+        # instead be bound to a binding that doesn't de-select all, this way:
+        # - Click-drag moves the current selection.
+        # - Click selects only the item at the cursor position.
+        # See: T97032.
         "use_tweak_select_passthrough",
         "use_tweak_tool_lmb_interaction",
         "use_mouse_emulate_3_button",
@@ -4705,6 +4711,11 @@ def _template_paint_radial_control(paint, rotation=False, secondary_rotation=Fal
 def _template_view3d_select(*, type, value, legacy, select_passthrough, exclude_mod=None):
     # NOTE: `exclude_mod` is needed since we don't want this tool to exclude Control-RMB actions when this is used
     # as a tool key-map with RMB-select and `use_fallback_tool_rmb` is enabled. See T92467.
+
+    # See: `use_tweak_select_passthrough` doc-string.
+    if select_passthrough and (value in {'CLICK', 'RELEASE'}):
+        select_passthrough = False
+
     items = [(
         "view3d.select",
         {"type": type, "value": value, **{m: True for m in mods}},
@@ -4721,7 +4732,7 @@ def _template_view3d_select(*, type, value, legacy, select_passthrough, exclude_
         (("toggle", "center", "enumerate"), ("shift", "ctrl", "alt")),
     ) if exclude_mod is None or exclude_mod not in mods]
 
-    if select_passthrough and (value == 'PRESS'):
+    if select_passthrough:
         # Add an additional click item to de-select all other items,
         # needed so pass-through is able to de-select other items.
         items.append((
@@ -4749,6 +4760,11 @@ def _template_view3d_gpencil_select(*, type, value, legacy, use_select_mouse=Tru
 
 
 def _template_uv_select(*, type, value, select_passthrough, legacy):
+
+    # See: `use_tweak_select_passthrough` doc-string.
+    if select_passthrough and (value in {'CLICK', 'RELEASE'}):
+        select_passthrough = False
+
     items = [
         ("uv.select", {"type": type, "value": value},
          {"properties": [
@@ -4759,7 +4775,7 @@ def _template_uv_select(*, type, value, select_passthrough, legacy):
          {"properties": [("toggle", True)]}),
     ]
 
-    if select_passthrough and (value == 'PRESS'):
+    if select_passthrough:
         # Add an additional click item to de-select all other items,
         # needed so pass-through is able to de-select other items.
         items.append((



More information about the Bf-blender-cvs mailing list