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:
@@ -7892,6 +7892,21 @@ def km_3d_view_tool_sculpt_box_hide(params):
|
||||
)
|
||||
|
||||
|
||||
def km_3d_view_tool_sculpt_lasso_hide(params):
|
||||
return (
|
||||
"3D View Tool: Sculpt, Lasso Hide",
|
||||
{"space_type": 'VIEW_3D', "region_type": 'WINDOW'},
|
||||
{"items": [
|
||||
("paint.hide_show_lasso_gesture", params.tool_maybe_tweak_event,
|
||||
{"properties": [("action", 'HIDE')]}),
|
||||
("paint.hide_show_lasso_gesture", {**params.tool_maybe_tweak_event, "ctrl": True},
|
||||
{"properties": [("action", 'SHOW')]}),
|
||||
("paint.hide_show_all", {"type": params.select_mouse, "value": params.select_mouse_value},
|
||||
{"properties": [("action", 'SHOW')]}),
|
||||
]},
|
||||
)
|
||||
|
||||
|
||||
def km_3d_view_tool_sculpt_box_mask(params):
|
||||
return (
|
||||
"3D View Tool: Sculpt, Box Mask",
|
||||
@@ -8737,6 +8752,7 @@ def generate_keymaps(params=None):
|
||||
km_3d_view_tool_edit_curve_extrude_to_cursor(params),
|
||||
km_3d_view_tool_edit_curves_draw(params),
|
||||
km_3d_view_tool_sculpt_box_hide(params),
|
||||
km_3d_view_tool_sculpt_lasso_hide(params),
|
||||
km_3d_view_tool_sculpt_box_mask(params),
|
||||
km_3d_view_tool_sculpt_lasso_mask(params),
|
||||
km_3d_view_tool_sculpt_box_face_set(params),
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user