Fix T65108: GPencil Sculpt mode select tools don't work

Move the sculpt keymap from the mode to the tool.
This commit is contained in:
Campbell Barton 2019-06-06 15:53:11 +10:00
parent f0ff593d97
commit b69ed14ff7
Notes: blender-bot 2023-02-14 06:42:53 +01:00
Referenced by issue #65699, GPencil Weight Painting unresponsive
Referenced by issue #65108, Grease Pencil Box & Lasso Select Tool do not work in Sculpt Mode
2 changed files with 21 additions and 7 deletions

View File

@ -3170,13 +3170,7 @@ def km_grease_pencil_stroke_sculpt_mode(params):
items.extend([
# Selection
*_grease_pencil_selection(params),
# Painting
("gpencil.sculpt_paint", {"type": 'LEFTMOUSE', "value": 'PRESS'},
{"properties": [("wait_for_input", False)]}),
("gpencil.sculpt_paint", {"type": 'LEFTMOUSE', "value": 'PRESS', "ctrl": True},
{"properties": [("wait_for_input", False)]}),
("gpencil.sculpt_paint", {"type": 'LEFTMOUSE', "value": 'PRESS', "shift": True},
{"properties": [("wait_for_input", False)]}),
# Brush strength
("wm.radial_control", {"type": 'F', "value": 'PRESS', "shift": True},
{"properties": [("data_path_primary", 'tool_settings.gpencil_sculpt.brush.strength')]}),
@ -5738,6 +5732,21 @@ def km_3d_view_tool_edit_gpencil_to_sphere(params):
)
def km_3d_view_tool_sculpt_gpencil_paint(params):
return (
"3D View Tool: Sculpt Gpencil, Paint",
{"space_type": 'VIEW_3D', "region_type": 'WINDOW'},
{"items": [
("gpencil.sculpt_paint", {"type": 'LEFTMOUSE', "value": 'PRESS'},
{"properties": [("wait_for_input", False)]}),
("gpencil.sculpt_paint", {"type": 'LEFTMOUSE', "value": 'PRESS', "ctrl": True},
{"properties": [("wait_for_input", False)]}),
("gpencil.sculpt_paint", {"type": 'LEFTMOUSE', "value": 'PRESS', "shift": True},
{"properties": [("wait_for_input", False)]}),
]},
)
def km_3d_view_tool_sculpt_gpencil_select(params):
return (
"3D View Tool: Sculpt Gpencil, Select",
@ -5972,6 +5981,7 @@ def generate_keymaps(params=None):
km_3d_view_tool_edit_gpencil_bend(params),
km_3d_view_tool_edit_gpencil_shear(params),
km_3d_view_tool_edit_gpencil_to_sphere(params),
km_3d_view_tool_sculpt_gpencil_paint(params),
km_3d_view_tool_sculpt_gpencil_select(params),
km_3d_view_tool_sculpt_gpencil_select_box(params),
km_3d_view_tool_sculpt_gpencil_select_circle(params),

View File

@ -1466,6 +1466,10 @@ class _defs_gpencil_sculpt:
icon_prefix="ops.gpencil.sculpt_",
type=bpy.types.GPencilSculptSettings,
attr="sculpt_tool",
tooldef_keywords=dict(
operator="gpencil.sculpt_paint",
keymap="3D View Tool: Sculpt Gpencil, Paint",
),
)