Keymap: improve consistency for paint modes #108791

Manually merged
Campbell Barton merged 8 commits from JulienKaspar/blender:draw-sculpt-paint-shortcut-consistency into main 2023-07-28 04:38:30 +02:00
1 changed files with 31 additions and 18 deletions
Showing only changes of commit 4b7f8c97b8 - Show all commits

View File

@ -5078,8 +5078,10 @@ def km_image_paint(params):
{"properties": [("mode", 'NORMAL')]}),
("paint.image_paint", {"type": 'LEFTMOUSE', "value": 'PRESS', "ctrl": True},
{"properties": [("mode", 'INVERT')]}),
("paint.image_paint", {"type": 'LEFTMOUSE', "value": 'PRESS', "shift": True},
{"properties": [("mode", 'SMOOTH')]}),
("paint.brush_colors_flip", {"type": 'X', "value": 'PRESS'}, None),
("paint.grab_clone", {"type": 'RIGHTMOUSE', "value": 'PRESS'}, None),
("paint.grab_clone", {"type": 'RIGHTMOUSE', "value": 'CLICK_DRAG'}, None),
("paint.sample_color", {"type": 'X', "value": 'PRESS', "shift": True}, None),
("brush.scale_size", {"type": 'LEFT_BRACKET', "value": 'PRESS', "repeat": True},
{"properties": [("scalar", 0.9)]}),
@ -5126,9 +5128,11 @@ def km_vertex_paint(params):
{"properties": [("mode", 'NORMAL')]}),
("paint.vertex_paint", {"type": 'LEFTMOUSE', "value": 'PRESS', "ctrl": True},
{"properties": [("mode", 'INVERT')]}),
("paint.vertex_paint", {"type": 'LEFTMOUSE', "value": 'PRESS', "shift": True},
{"properties": [("mode", 'SMOOTH')]}),
("paint.brush_colors_flip", {"type": 'X', "value": 'PRESS'}, None),
("paint.sample_color", {"type": 'X', "value": 'PRESS', "shift": True}, None),
("paint.vertex_color_set", {"type": 'K', "value": 'PRESS', "shift": True}, None),
("paint.vertex_color_set", {"type": 'X', "value": 'PRESS', "ctrl": True}, None),
("brush.scale_size", {"type": 'LEFT_BRACKET', "value": 'PRESS', "repeat": True},
{"properties": [("scalar", 0.9)]}),
("brush.scale_size", {"type": 'RIGHT_BRACKET', "value": 'PRESS', "repeat": True},
@ -5150,7 +5154,7 @@ def km_vertex_paint(params):
{"properties": [("data_path", 'vertex_paint_object.data.use_paint_mask')]}),
("wm.context_toggle", {"type": 'S', "value": 'PRESS', "shift": True},
{"properties": [("data_path", 'tool_settings.vertex_paint.brush.use_smooth_stroke')]}),
("wm.context_menu_enum", {"type": 'E', "value": 'PRESS'},
("wm.context_menu_enum", {"type": 'E', "value": 'PRESS', "alt": True},
{"properties": [("data_path", 'tool_settings.vertex_paint.brush.stroke_method')]}),
("paint.face_vert_reveal", {"type": 'H', "value": 'PRESS', "alt": True}, None),
*_template_items_context_panel("VIEW3D_PT_paint_vertex_context_menu", params.context_menu_event),
@ -5176,12 +5180,19 @@ def km_weight_paint(params):
)
items.extend([
("paint.weight_paint", {"type": 'LEFTMOUSE', "value": 'PRESS', "shift": True}, None),
("paint.weight_paint", {"type": 'LEFTMOUSE', "value": 'PRESS'},
{"properties": [("mode", 'NORMAL')]}),
("paint.weight_paint", {"type": 'LEFTMOUSE', "value": 'PRESS', 'ctrl': True},
{"properties": [("mode", 'INVERT')]}),
("paint.weight_paint", {"type": 'LEFTMOUSE', "value": 'PRESS', 'shift': True},
{"properties": [("mode", 'SMOOTH')]}),
("paint.weight_sample", {"type": 'X', "value": 'PRESS', "shift": True}, None),
("paint.weight_sample_group", {"type": 'X', "value": 'PRESS', "ctrl": True, "shift": True}, None),
("paint.weight_gradient", {"type": 'LEFTMOUSE', "value": 'PRESS', "ctrl": True, "alt": True},
("paint.weight_gradient", {"type": 'A', "value": 'PRESS', "shift": True, "alt": True},
{"properties": [("type", 'RADIAL')]}),
("paint.weight_set", {"type": 'K', "value": 'PRESS', "shift": True}, None),
("paint.weight_gradient", {"type": 'A', "value": 'PRESS', "shift": True},
{"properties": [("type", 'LINEAR')]}),
("paint.weight_set", {"type": 'X', "value": 'PRESS', "ctrl": True}, None),
("brush.scale_size", {"type": 'LEFT_BRACKET', "value": 'PRESS', "repeat": True},
{"properties": [("scalar", 0.9)]}),
("brush.scale_size", {"type": 'RIGHT_BRACKET', "value": 'PRESS', "repeat": True},
@ -5189,7 +5200,7 @@ def km_weight_paint(params):
*_template_paint_radial_control("weight_paint"),
("wm.radial_control", {"type": 'F', "value": 'PRESS', "ctrl": True},
radial_control_properties("weight_paint", 'weight', 'use_unified_weight')),
("wm.context_menu_enum", {"type": 'E', "value": 'PRESS'},
("wm.context_menu_enum", {"type": 'E', "value": 'PRESS', 'alt': True},
{"properties": [("data_path", 'tool_settings.vertex_paint.brush.stroke_method')]}),
("wm.context_toggle", {"type": 'M', "value": 'PRESS'},
{"properties": [("data_path", 'weight_paint_object.data.use_paint_mask')]}),
@ -5266,7 +5277,7 @@ def km_sculpt(params):
("invert", False),
("use_mask_preserve", True),
]}),
("sculpt.expand", {"type": 'W', "value": 'PRESS', "shift": True},
("sculpt.expand", {"type": 'E', "value": 'PRESS', "shift": True},
{"properties": [
("target", "FACE_SETS"),
("falloff_type", "GEODESIC"),
@ -5274,7 +5285,7 @@ def km_sculpt(params):
("use_mask_preserve", False),
("use_modify_active", False),
]}),
("sculpt.expand", {"type": 'W', "value": 'PRESS', "shift": True, "alt": True},
("sculpt.expand", {"type": 'E', "value": 'PRESS', "shift": True, "alt": True},
{"properties": [
("target", "FACE_SETS"),
("falloff_type", "BOUNDARY_FACE_SET"),
@ -5284,22 +5295,22 @@ def km_sculpt(params):
]}),
# Partial Visibility Show/hide
# Match keys from: `_template_items_hide_reveal_actions`, cannot use because arguments aren't compatible.
("sculpt.face_set_change_visibility", {"type": 'H', "value": 'PRESS'},
{"properties": [("mode", 'TOGGLE')]}),
("sculpt.face_set_change_visibility", {"type": 'H', "value": 'PRESS', "shift": True},
{"properties": [("mode", 'TOGGLE')]}),
("sculpt.face_set_change_visibility", {"type": 'H', "value": 'PRESS'},
{"properties": [("mode", 'HIDE_ACTIVE')]}),
("sculpt.reveal_all", {"type": 'H', "value": 'PRESS', "alt": True},
{"properties": []}),
("sculpt.face_set_edit", {"type": 'W', "value": 'PRESS', "ctrl": True},
("sculpt.face_set_edit", {"type": 'E', "value": 'PRESS', "ctrl": True},
{"properties": [("mode", 'GROW')]}),
("sculpt.face_set_edit", {"type": 'W', "value": 'PRESS', "ctrl": True, "alt": True},
("sculpt.face_set_edit", {"type": 'E', "value": 'PRESS', "shift": True, "ctrl": True},
{"properties": [("mode", 'SHRINK')]}),
# Subdivision levels
*_template_items_object_subdivision_set(),
("object.subdivision_set", {"type": 'PAGE_UP', "value": 'PRESS', "repeat": True},
("object.subdivision_set", {"type": '2', "value": 'PRESS', 'alt': True, "repeat": True},
{"properties": [("level", 1), ("relative", True)]}),
("object.subdivision_set", {"type": 'PAGE_DOWN', "value": 'PRESS', "repeat": True},
("object.subdivision_set", {"type": '1', "value": 'PRESS', 'alt': True, "repeat": True},
{"properties": [("level", -1), ("relative", True)]}),
# Mask
("paint.mask_flood_fill", {"type": 'M', "value": 'PRESS', "alt": True},
@ -5315,12 +5326,14 @@ def km_sculpt(params):
("sculpt.dynamic_topology_toggle", {"type": 'D', "value": 'PRESS', "ctrl": True}, None),
("sculpt.dyntopo_detail_size_edit", {"type": 'R', "value": 'PRESS'}, None),
("sculpt.set_detail_size", {"type": 'D', "value": 'PRESS', "shift": True, "alt": True}, None),
("sculpt.detail_flood_fill", {"type": 'R', "value": 'PRESS', "ctrl": True}, None),
# Remesh
("object.voxel_remesh", {"type": 'R', "value": 'PRESS', "ctrl": True}, None),
("object.voxel_size_edit", {"type": 'R', "value": 'PRESS'}, None),
("object.quadriflow_remesh", {"type": 'R', "value": 'PRESS', "ctrl": True, "alt": True}, None),
# Color
("sculpt.sample_color", {"type": 'X', "value": 'PRESS', "shift": True,}, None),
("sculpt.sample_color", {"type": 'X', "value": 'PRESS', "shift": True}, None),
("paint.brush_colors_flip", {"type": 'X', "value": 'PRESS',}, None),
# Brush properties
("brush.scale_size", {"type": 'LEFT_BRACKET', "value": 'PRESS', "repeat": True},
{"properties": [("scalar", 0.9)]}),
@ -5364,13 +5377,13 @@ def km_sculpt(params):
("paint.brush_select", {"type": 'M', "value": 'PRESS'},
{"properties": [("sculpt_tool", 'MASK'), ("toggle", True), ("create_missing", True)]}),
# Menus
("wm.context_menu_enum", {"type": 'E', "value": 'PRESS'},
("wm.context_menu_enum", {"type": 'E', "value": 'PRESS', 'alt': True},
{"properties": [("data_path", 'tool_settings.sculpt.brush.stroke_method')]}),
("wm.context_toggle", {"type": 'S', "value": 'PRESS', "shift": True},
{"properties": [("data_path", 'tool_settings.sculpt.brush.use_smooth_stroke')]}),
op_menu_pie("VIEW3D_MT_sculpt_mask_edit_pie", {"type": 'A', "value": 'PRESS'}),
op_menu_pie("VIEW3D_MT_sculpt_automasking_pie", {"type": 'A', "alt": True, "value": 'PRESS'}),
op_menu_pie("VIEW3D_MT_sculpt_face_sets_edit_pie", {"type": 'W', "value": 'PRESS'}),
op_menu_pie("VIEW3D_MT_sculpt_face_sets_edit_pie", {"type": 'E', "value": 'PRESS'}),
*_template_items_context_panel("VIEW3D_PT_sculpt_context_menu", params.context_menu_event),
])