diff options
author | Campbell Barton <campbell@blender.org> | 2022-05-20 09:07:32 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-05-20 09:07:32 +0300 |
commit | f68fb8106429b4d6fb3e019940db79c17af94ad6 (patch) | |
tree | f6f9ca63cfe264583f4f6518be9a7ea1acc4257f /release | |
parent | 1a627d528cf91a58893e31ce89a6114eec2a6630 (diff) |
Fix T98145: IC keymap can't select & move multiple nodes
Regression from [0] which changed operator properties without
updating this keymap.
[0]: 4c3e91e5f565b81dd79b5d42f55be5b93662d410
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py | 52 |
1 files changed, 31 insertions, 21 deletions
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", |