Sculpt: Option to mask front faces only using Lasso and Box Mask

This adds a property that checks the normals of each vertex against the
view direction to decide if they should be masked (similar to the
"Front Faces Only" option works for brushes.

Reviewed By: sergey

Maniphest Tasks: T77637

Differential Revision: https://developer.blender.org/D8448
This commit is contained in:
Pablo Dobarro
2020-08-10 17:04:18 +02:00
parent ed9c0464ba
commit af77bf1f0f
2 changed files with 65 additions and 2 deletions

View File

@@ -1226,22 +1226,32 @@ class _defs_sculpt:
@ToolDef.from_fn
def mask_border():
def draw_settings(_context, layout, tool):
props = tool.operator_properties("paint.mask_box_gesture")
layout.prop(props, "use_front_faces_only", expand=False)
return dict(
idname="builtin.box_mask",
label="Box Mask",
icon="ops.sculpt.border_mask",
widget=None,
keymap=(),
draw_settings=draw_settings,
)
@ToolDef.from_fn
def mask_lasso():
def draw_settings(_context, layout, tool):
props = tool.operator_properties("paint.mask_lasso_gesture")
layout.prop(props, "use_front_faces_only", expand=False)
return dict(
idname="builtin.lasso_mask",
label="Lasso Mask",
icon="ops.sculpt.lasso_mask",
widget=None,
keymap=(),
draw_settings=draw_settings,
)
@ToolDef.from_fn