diff options
author | Jacques Lucke <jacques@blender.org> | 2022-02-18 11:12:41 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2022-02-18 11:14:54 +0300 |
commit | 61aaeb3745ad72c681c17f4535dd06ffaaf78c58 (patch) | |
tree | c843b445e3e68938aa8c1f5f704dc55eb2be5c6d /release/scripts | |
parent | 964d3a38fac8fd9ba90e6a94d26546f2d0651116 (diff) |
Curves: initial brush system integration for curves sculpt mode
This adds the boilerplate code that is necessary to use the tool/brush/paint
systems in the new sculpt curves mode.
Two temporary dummy tools are part of this patch. They do nothing and
only serve to test the boilerplate. When the first actual tool is added,
those dummy tools will be removed.
Differential Revision: https://developer.blender.org/D14117
Diffstat (limited to 'release/scripts')
3 files changed, 33 insertions, 0 deletions
diff --git a/release/scripts/modules/bl_keymap_utils/keymap_from_toolbar.py b/release/scripts/modules/bl_keymap_utils/keymap_from_toolbar.py index 604d1ffd547..6d41e290512 100644 --- a/release/scripts/modules/bl_keymap_utils/keymap_from_toolbar.py +++ b/release/scripts/modules/bl_keymap_utils/keymap_from_toolbar.py @@ -189,6 +189,7 @@ def generate(context, space_type, *, use_fallback_keys=True, use_reset=True): 'VERTEX_GPENCIL': "gpencil_vertex_tool", 'SCULPT_GPENCIL': "gpencil_sculpt_tool", 'WEIGHT_GPENCIL': "gpencil_weight_tool", + 'SCULPT_CURVES': "curves_sculpt_tool", }.get(mode, None) else: attr = None diff --git a/release/scripts/presets/keyconfig/keymap_data/blender_default.py b/release/scripts/presets/keyconfig/keymap_data/blender_default.py index 8884b835130..7373615d5ff 100644 --- a/release/scripts/presets/keyconfig/keymap_data/blender_default.py +++ b/release/scripts/presets/keyconfig/keymap_data/blender_default.py @@ -5450,6 +5450,21 @@ def km_font(params): return keymap +def km_sculpt_curves(params): + items = [] + keymap = ( + "Sculpt Curves", + {"space_type": 'EMPTY', "region_type": 'WINDOW'}, + {"items": items}, + ) + + items.extend([ + ("sculpt_curves.brush_stroke", {"type": 'LEFTMOUSE', "value": 'PRESS'}, None), + ]) + + return keymap + + def km_object_non_modal(params): items = [] keymap = ( @@ -7771,6 +7786,7 @@ def generate_keymaps(params=None): km_lattice(params), km_particle(params), km_font(params), + km_sculpt_curves(params), km_object_non_modal(params), # Modal maps. diff --git a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py index 338bf5a9d5d..f4aa4c50d76 100644 --- a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py +++ b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py @@ -2306,6 +2306,19 @@ class _defs_gpencil_weight: ) +class _defs_curves_sculpt: + + @staticmethod + def generate_from_brushes(context): + return generate_from_enum_ex( + context, + idname_prefix="builtin_brush.", + icon_prefix="ops.curves.sculpt_", + type= bpy.types.Brush, + attr="curves_sculpt_tool", + ) + + class _defs_gpencil_vertex: @staticmethod @@ -3065,6 +3078,9 @@ class VIEW3D_PT_tools_active(ToolSelectPanelHelper, Panel): else () ), ], + 'SCULPT_CURVES': [ + _defs_curves_sculpt.generate_from_brushes, + ], } |