diff options
author | Campbell Barton <campbell@blender.org> | 2022-05-20 09:11:28 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-05-20 09:11:28 +0300 |
commit | f0495919676da0ae9b7923fc8cbd512443c940b1 (patch) | |
tree | 423df9f31cd394db88f6e86f4ece04a356c4514f /release/scripts/presets | |
parent | f61dd33f50fc8bc9e0ddfdd9c223db0e31a91dc0 (diff) | |
parent | f68fb8106429b4d6fb3e019940db79c17af94ad6 (diff) |
Merge branch 'blender-v3.2-release'
Diffstat (limited to 'release/scripts/presets')
-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", |