diff options
author | Pablo Dobarro <pablodp606@gmail.com> | 2020-09-05 21:06:27 +0300 |
---|---|---|
committer | Pablo Dobarro <pablodp606@gmail.com> | 2020-09-07 18:31:34 +0300 |
commit | 675c9644420eba96751e1cadedd2656a8bc39191 (patch) | |
tree | 6801746d154bea43a4e1caf17603e397ed945129 /release/scripts | |
parent | 1dc11d15a60b1fdb21f72c9bd39ba27e3acdb80f (diff) |
Sculpt: Sculpt Trimming gestures tools
This implements Box Trim as a boolean based trimming too gesture in sculpt
mode. This is the intended way to remove parts of the sculpt instead of
using box mask and mask slice. It also creates new face sets for the new
faces created after the boolean operation.
Reviewed By: sergey
Differential Revision: https://developer.blender.org/D8766
Diffstat (limited to 'release/scripts')
-rw-r--r-- | release/scripts/presets/keyconfig/keymap_data/blender_default.py | 23 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/space_toolsystem_toolbar.py | 24 |
2 files changed, 46 insertions, 1 deletions
diff --git a/release/scripts/presets/keyconfig/keymap_data/blender_default.py b/release/scripts/presets/keyconfig/keymap_data/blender_default.py index acb2e731e12..53b45ed6c90 100644 --- a/release/scripts/presets/keyconfig/keymap_data/blender_default.py +++ b/release/scripts/presets/keyconfig/keymap_data/blender_default.py @@ -6332,7 +6332,6 @@ def km_3d_view_tool_sculpt_box_face_set(params): ]}, ) - def km_3d_view_tool_sculpt_lasso_face_set(params): return ( "3D View Tool: Sculpt, Lasso Face Set", @@ -6342,6 +6341,26 @@ def km_3d_view_tool_sculpt_lasso_face_set(params): None), ]}, ) + +def km_3d_view_tool_sculpt_box_trim(params): + return ( + "3D View Tool: Sculpt, Box Trim", + {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, + {"items": [ + ("sculpt.trim_box_gesture", {"type": params.tool_tweak, "value": 'ANY'}, + None), + ]}, + ) + +def km_3d_view_tool_sculpt_lasso_trim(params): + return ( + "3D View Tool: Sculpt, Lasso Trim", + {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, + {"items": [ + ("sculpt.trim_lasso_gesture", {"type": params.tool_tweak, "value": 'ANY'}, + None), + ]}, + ) def km_3d_view_tool_sculpt_mesh_filter(params): return ( @@ -6938,6 +6957,8 @@ def generate_keymaps(params=None): km_3d_view_tool_sculpt_lasso_mask(params), km_3d_view_tool_sculpt_box_face_set(params), km_3d_view_tool_sculpt_lasso_face_set(params), + km_3d_view_tool_sculpt_box_trim(params), + km_3d_view_tool_sculpt_lasso_trim(params), km_3d_view_tool_sculpt_mesh_filter(params), km_3d_view_tool_sculpt_cloth_filter(params), km_3d_view_tool_sculpt_color_filter(params), diff --git a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py index c17b981a6b8..ab7ac007257 100644 --- a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py +++ b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py @@ -1284,6 +1284,26 @@ class _defs_sculpt: draw_settings=draw_settings, ) + @ToolDef.from_fn + def trim_box(): + return dict( + idname="builtin.box_trim", + label="Box Trim", + icon="ops.sculpt.box_trim", + widget=None, + keymap=(), + ) + + @ToolDef.from_fn + def trim_lasso(): + return dict( + idname="builtin.lasso_trim", + label="Lasso Trim", + icon="ops.sculpt.lasso_trim", + widget=None, + keymap=(), + ) + @ToolDef.from_fn def mesh_filter(): @@ -2632,6 +2652,10 @@ class VIEW3D_PT_tools_active(ToolSelectPanelHelper, Panel): _defs_sculpt.face_set_lasso, ), _defs_sculpt.hide_border, + ( + _defs_sculpt.trim_box, + _defs_sculpt.trim_lasso, + ), None, _defs_sculpt.mesh_filter, _defs_sculpt.cloth_filter, |