Left and Right Click consistency improvements #110960
@ -3637,7 +3637,7 @@ def km_grease_pencil(params):
|
||||
return keymap
|
||||
|
||||
|
||||
def _grease_pencil_selection(params, *, use_select_mouse=True):
|
||||
def _grease_pencil_selection(params, *, alt_select=False):
|
||||
return [
|
||||
# Select all
|
||||
*_template_items_select_actions(params, "gpencil.select_all"),
|
||||
@ -3654,26 +3654,20 @@ def _grease_pencil_selection(params, *, use_select_mouse=True):
|
||||
{"properties": [("mode", 'ADD')]}),
|
||||
("gpencil.select_lasso", {"type": params.action_mouse, "value": 'CLICK_DRAG', "shift": True, "ctrl": True},
|
||||
{"properties": [("mode", 'SUB')]}),
|
||||
# In the Node Editor, lasso select needs ALT modifier too
|
||||
# (as somehow CTRL+LMB drag gets taken for "cut" quite early).
|
||||
# There probably isn't too much harm adding this for other editors too
|
||||
# as part of standard GP editing keymap. This hotkey combo doesn't seem
|
||||
# to see much use under standard scenarios?
|
||||
("gpencil.select_lasso",
|
||||
{"type": params.action_mouse, "value": 'CLICK_DRAG', "ctrl": True, "alt": True},
|
||||
{"properties": [("mode", 'ADD')]}),
|
||||
("gpencil.select_lasso",
|
||||
{"type": params.action_mouse, "value": 'CLICK_DRAG', "shift": True, "ctrl": True, "alt": True},
|
||||
{"properties": [("mode", 'SUB')]}),
|
||||
*_template_view3d_gpencil_select(
|
||||
type=params.select_mouse,
|
||||
value=params.select_mouse_value_fallback,
|
||||
legacy=params.legacy,
|
||||
use_select_mouse=use_select_mouse,
|
||||
alt_select=alt_select
|
||||
),
|
||||
# Select linked
|
||||
("gpencil.select_linked", {"type": 'L', "value": 'PRESS'}, None),
|
||||
("gpencil.select_linked", {"type": 'L', "value": 'PRESS', "ctrl": True}, None),
|
||||
# Whole stroke select
|
||||
# Same behavior and use case as select linked pick
|
||||
("gpencil.select", {"type": 'L', "value": 'PRESS'},
|
||||
{"properties": [("extend", True), ("entire_strokes", True)]}),
|
||||
("gpencil.select", {"type": 'L', "value": 'PRESS', "shift": True},
|
||||
{"properties": [("deselect", True), ("extend", True), ("entire_strokes", True)]}),
|
||||
# Select grouped
|
||||
("gpencil.select_grouped", {"type": 'G', "value": 'PRESS', "shift": True}, None),
|
||||
# Select more/less
|
||||
@ -3989,7 +3983,7 @@ def km_grease_pencil_stroke_sculpt_mode(params):
|
||||
|
||||
items.extend([
|
||||
# Selection
|
||||
*_grease_pencil_selection(params, use_select_mouse=not params.use_fallback_tool_select_mouse),
|
||||
*_grease_pencil_selection(params, alt_select=True),
|
||||
# Selection mode
|
||||
("wm.context_toggle", {"type": 'ONE', "value": 'PRESS'},
|
||||
{"properties": [("data_path", 'scene.tool_settings.use_gpencil_select_mask_point')]}),
|
||||
@ -4346,7 +4340,7 @@ def km_grease_pencil_stroke_vertex_mode(params):
|
||||
|
||||
items.extend([
|
||||
# Selection
|
||||
*_grease_pencil_selection(params, use_select_mouse=not params.use_fallback_tool_select_mouse),
|
||||
*_grease_pencil_selection(params, alt_select=True),
|
||||
# Selection mode
|
||||
("wm.context_toggle", {"type": 'ONE', "value": 'PRESS'},
|
||||
{"properties": [("data_path", 'scene.tool_settings.use_gpencil_vertex_select_mask_point')]}),
|
||||
@ -4916,19 +4910,23 @@ def _template_view3d_paint_mask_select_loop(params):
|
||||
]
|
||||
|
||||
|
||||
def _template_view3d_gpencil_select(*, type, value, legacy, use_select_mouse=True):
|
||||
return [
|
||||
*([] if not use_select_mouse else [
|
||||
def _template_view3d_gpencil_select(*, type, value, legacy, alt_select=False):
|
||||
items = [
|
||||
("gpencil.select", {"type": type, "value": value},
|
||||
{"properties": [("deselect_all", not legacy)]})]),
|
||||
("gpencil.select", {"type": type, "value": value, "shift": True},
|
||||
{"properties": [("extend", True), ("toggle", True)]}),
|
||||
# Whole stroke select
|
||||
("gpencil.select", {"type": type, "value": value, "alt": True},
|
||||
{"properties": [("entire_strokes", True)]}),
|
||||
("gpencil.select", {"type": type, "value": value, "shift": True, "alt": True},
|
||||
{"properties": [("extend", True), ("entire_strokes", True)]}),
|
||||
{"properties": [("deselect_all", not legacy)]}),
|
||||
("gpencil.select", {"type": type, "value": value, "shift": True},
|
||||
{"properties": [("extend", True), ("toggle", True)]}),
|
||||
]
|
||||
if type == 'LEFTMOUSE' and alt_select == True:
|
||||
items.extend([
|
||||
# Selection shortcuts for when brushes are active on LCS
|
||||
("gpencil.select", {"type": type, "value": value, "alt": True},
|
||||
{"properties": [("deselect_all", True)]}),
|
||||
("gpencil.select", {"type": type, "value": value, "alt": True, "shift": True},
|
||||
{"properties": [("extend", True), ("toggle", True)]}),
|
||||
])
|
||||
|
||||
return items
|
||||
|
||||
|
||||
def _template_node_select(*, type, value, select_passthrough):
|
||||
@ -5337,7 +5335,6 @@ def km_sculpt(params):
|
||||
{"properties": [("mode", 'INVERT')]}),
|
||||
("paint.mask_box_gesture", {"type": 'B', "value": 'PRESS'},
|
||||
{"properties": [("mode", 'VALUE'), ("value", 0.0)]}),
|
||||
("paint.mask_lasso_gesture", {"type": 'LEFTMOUSE', "value": 'PRESS', "shift": True, "ctrl": True}, None),
|
||||
# Dynamic topology
|
||||
("sculpt.dyntopo_detail_size_edit", {"type": 'R', "value": 'PRESS'}, None),
|
||||
("sculpt.detail_flood_fill", {"type": 'R', "value": 'PRESS', "ctrl": True}, None),
|
||||
@ -5380,6 +5377,20 @@ def km_sculpt(params):
|
||||
*_template_items_context_panel("VIEW3D_PT_sculpt_context_menu", params.context_menu_event),
|
||||
])
|
||||
|
||||
# Lasso Masking
|
||||
|
||||
if params.select_mouse == 'RIGHTMOUSE':
|
||||
items.extend([
|
||||
("paint.mask_lasso_gesture", {"type": 'LEFTMOUSE', "value": 'PRESS', "shift": True, "ctrl": True},
|
||||
{"properties": [("value", 1.0)]}),
|
||||
])
|
||||
else:
|
||||
items.extend([
|
||||
("paint.mask_lasso_gesture", {"type": 'RIGHTMOUSE', "value": 'PRESS', "shift": True, "ctrl": True},
|
||||
{"properties": [("value", 1.0)]}),
|
||||
("paint.mask_lasso_gesture", {"type": 'RIGHTMOUSE', "value": 'PRESS', "ctrl": True},
|
||||
{"properties": [("value", 0.0)]}),
|
||||
])
|
||||
|
||||
if params.legacy:
|
||||
items.extend(_template_items_legacy_tools_from_numbers())
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user
It seems a bit weak that RMB can set the mask but not clear it, how about use alt for clearing mask? (e.g.)
Done.
But
paint.mask_lasso_gesture
is using an inverted paradigm so I flipped the numbers.Ctrl Shift LMB
is masking (equivilant to deselecting in edit mode).I also changed the value to
CLICK_DRAG
.I added the function
_template_items_select_lasso
to add the same shortcuts to other painting modes and Gpencil modes. Curve Sculpt mode can add this too once lasso select is supported.