Sculpt: Add Lasso Hide tool

This commit adds the `SCULPT_OT_hide_show_lasso_gesture` and the
corresponding Lasso Hide tool.

* Exposes the selection type for both the lasso and box hide tools
  as a option in the header
* Adds functionality into `sculpt_gesture.cc` for handling lasso
  selections with the `Outside` selection type

For `SelectionType::Outside`, the current implementation opts to not
do any filtering on the PBVH node level due to cases where the node
is mostly covered by a single gesture.

Addresses one of the tools in #80390

Pull Request: https://projects.blender.org/blender/blender/pulls/119140
This commit is contained in:
Sean Kim
2024-03-12 14:19:02 +01:00
committed by Hans Goudey
parent aaadb5005e
commit 68afd22501
11 changed files with 98 additions and 4 deletions
@@ -1381,12 +1381,32 @@ class _defs_sculpt:
@ToolDef.from_fn
def hide_border():
def draw_settings(_context, layout, tool):
props = tool.operator_properties("paint.hide_show")
layout.prop(props, "area", expand=False)
return dict(
idname="builtin.box_hide",
label="Box Hide",
icon="ops.sculpt.border_hide",
widget=None,
keymap=(),
draw_settings=draw_settings,
)
@ToolDef.from_fn
def hide_lasso():
def draw_settings(_context, layout, tool):
props = tool.operator_properties("paint.hide_show_lasso_gesture")
layout.prop(props, "area", expand=False)
return dict(
idname="builtin.lasso_hide",
label="Lasso Hide",
icon="ops.sculpt.lasso_hide",
widget=None,
keymap=(),
draw_settings=draw_settings,
)
@ToolDef.from_fn
@@ -3077,7 +3097,10 @@ class VIEW3D_PT_tools_active(ToolSelectPanelHelper, Panel):
_defs_sculpt.mask_lasso,
_defs_sculpt.mask_line,
),
_defs_sculpt.hide_border,
(
_defs_sculpt.hide_border,
_defs_sculpt.hide_lasso
),
(
_defs_sculpt.face_set_box,
_defs_sculpt.face_set_lasso,
+6
View File
@@ -3573,6 +3573,12 @@ class VIEW3D_MT_sculpt(Menu):
props = layout.operator("paint.hide_show", text="Box Show")
props.action = 'SHOW'
props = layout.operator("paint.hide_show_lasso_gesture", text="Lasso Hide")
props.action = 'HIDE'
props = layout.operator("paint.hide_show_lasso_gesture", text="Lasso Show")
props.action = 'SHOW'
layout.separator()
props = layout.operator("sculpt.face_set_change_visibility", text="Toggle Visibility")