Fix #115887: Fallback tool only tweaks single elements

Use the same pass-through option when the select tool is used as a
fallback.
This commit is contained in:
Campbell Barton
2023-12-08 18:06:23 +11:00
parent 9c5ddd17aa
commit 9ddd5126fe

View File

@@ -565,18 +565,18 @@ def _template_items_tool_select(
cursor_prioritize=False,
fallback=False,
):
if not params.legacy and not fallback:
select_passthrough = False
if not params.legacy:
# Experimental support for LMB interaction for the tweak tool. see: #96544.
# 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 = True
if select_passthrough:
if not fallback and select_passthrough:
return [
(operator, {"type": 'LEFTMOUSE', "value": 'PRESS'},
{"properties": [("deselect_all", True), ("select_passthrough", True)]}),
@@ -592,7 +592,11 @@ def _template_items_tool_select(
# unless it is expected that the tool should operate on the selection (click-drag to rip for e.g.).
return [
(operator, {"type": 'LEFTMOUSE', "value": 'PRESS'},
{"properties": [("deselect_all", True)]}),
{"properties": [
("deselect_all", True),
# Without this, fallback tool doesn't support pass-through, see: #115887.
*((("select_passthrough", True),) if select_passthrough else ()),
]}),
(operator, {"type": 'LEFTMOUSE', "value": 'PRESS', "shift": True},
{"properties": [("toggle", True)]}),