[Bf-blender-cvs] [f68fb810642] blender-v3.2-release: Fix T98145: IC keymap can't select & move multiple nodes

Campbell Barton noreply at git.blender.org
Fri May 20 08:10:37 CEST 2022


Commit: f68fb8106429b4d6fb3e019940db79c17af94ad6
Author: Campbell Barton
Date:   Fri May 20 16:07:32 2022 +1000
Branches: blender-v3.2-release
https://developer.blender.org/rBf68fb8106429b4d6fb3e019940db79c17af94ad6

Fix T98145: IC keymap can't select & move multiple nodes

Regression from [0] which changed operator properties without
updating this keymap.

[0]: 4c3e91e5f565b81dd79b5d42f55be5b93662d410

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

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

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

diff --git a/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py b/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py
index 1459b0178a8..84602ece647 100644
--- a/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py
+++ b/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py
@@ -1066,29 +1066,9 @@ def km_node_editor(params):
         {"items": items},
     )
 
-    def node_select_ops(select_mouse):
-        return [
-            ("node.select", {"type": select_mouse, "value": 'PRESS'},
-             {"properties": [("extend", False), ("deselect_all", True)]}),
-            ("node.select", {"type": select_mouse, "value": 'PRESS', "ctrl": True},
-             {"properties": [("extend", False)]}),
-            ("node.select", {"type": select_mouse, "value": 'PRESS', "alt": True},
-             {"properties": [("extend", False)]}),
-            ("node.select", {"type": select_mouse, "value": 'PRESS', "ctrl": True, "alt": True},
-             {"properties": [("extend", False)]}),
-            ("node.select", {"type": select_mouse, "value": 'PRESS', "shift": True},
-             {"properties": [("extend", True)]}),
-            ("node.select", {"type": select_mouse, "value": 'PRESS', "shift": True, "ctrl": True},
-             {"properties": [("extend", True)]}),
-            ("node.select", {"type": select_mouse, "value": 'PRESS', "shift": True, "alt": True},
-             {"properties": [("extend", True)]}),
-            ("node.select", {"type": select_mouse, "value": 'PRESS', "shift": True, "ctrl": True, "alt": True},
-             {"properties": [("extend", True)]}),
-        ]
-
     # Allow node selection with both for RMB select
 
-    items.extend(node_select_ops('LEFTMOUSE'))
+    items.extend(_template_node_select(type='LEFTMOUSE', value='PRESS', select_passthrough=True))
 
     items.extend([
         ("node.select_box", {"type": 'LEFTMOUSE', "value": 'CLICK_DRAG'},
@@ -4053,6 +4033,36 @@ def km_3d_view_tool_edit_gpencil_select(params):
     )
 
 
+# NOTE: duplicated from `blender_default.py`.
+def _template_node_select(*, type, value, select_passthrough):
+    items = [
+        ("node.select", {"type": type, "value": value},
+         {"properties": [("deselect_all", True), ("select_passthrough", True)]}),
+        ("node.select", {"type": type, "value": value, "ctrl": True}, None),
+        ("node.select", {"type": type, "value": value, "alt": True}, None),
+        ("node.select", {"type": type, "value": value, "ctrl": True, "alt": True}, None),
+        ("node.select", {"type": type, "value": value, "shift": True},
+         {"properties": [("toggle", True)]}),
+        ("node.select", {"type": type, "value": value, "shift": True, "ctrl": True},
+         {"properties": [("toggle", True)]}),
+        ("node.select", {"type": type, "value": value, "shift": True, "alt": True},
+         {"properties": [("toggle", True)]}),
+        ("node.select", {"type": type, "value": value, "shift": True, "ctrl": True, "alt": True},
+         {"properties": [("toggle", True)]}),
+    ]
+
+    if select_passthrough and (value == 'PRESS'):
+        # Add an additional click item to de-select all other items,
+        # needed so pass-through is able to de-select other items.
+        items.append((
+            "node.select",
+            {"type": type, "value": 'CLICK'},
+            {"properties": [("deselect_all", True)]},
+        ))
+
+    return items
+
+
 def km_3d_view_tool_interactive_add(params):
     return (
         "3D View Tool: Object, Add Primitive",



More information about the Bf-blender-cvs mailing list