diff options
author | Joseph Eagar <joeedh@gmail.com> | 2022-09-29 02:22:34 +0300 |
---|---|---|
committer | Joseph Eagar <joeedh@gmail.com> | 2022-09-29 02:22:34 +0300 |
commit | 0156a677c7d13106a1d049d74fca43b5311eb53e (patch) | |
tree | 9e2c73fc0349cde80555dbe0cbf67e2dfb531011 /release | |
parent | 53ac3192ba07c4271c86479186ed0d0b8cd7846f (diff) |
Sculpt: New Cavity Automasking Mode
Add new cavity automasking mode based on local mesh
curvature. Cavity masking is a great way to quickly add
detail in crevices and the like. It's meant to be used
with the Paint brush in color attribute mode. It does
work with other brushes but the results can be unpredictable.
{F13131497}
The old "dirty mask" operator has been replace with a new
"mask from cavity" operator that shares the same code with
cavity automasking.
Differences from the sculpt-dev implementation:
* It uses the word "cavity." When I first implemented
this I wasn't aware
this feature existed in other software (and other
paint modes in Blender),
and for reasons that escape me today I initially
decided to call it a concave or
concavity mask.
* The cavity factor works a bit differently. It's
no longer non-linear and functions as a simple
scale around 0.5f.
* Supports custom curves.
* Supports blurring.
Reviewed By: Julian Kaspar, Jeroen Bakker and Campbell Barton
Differential Revision: https://developer.blender.org/D15122
Ref D15122
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/startup/bl_ui/properties_paint_common.py | 14 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/space_view3d.py | 5 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/space_view3d_toolbar.py | 26 |
3 files changed, 42 insertions, 3 deletions
diff --git a/release/scripts/startup/bl_ui/properties_paint_common.py b/release/scripts/startup/bl_ui/properties_paint_common.py index 9b1cf11f6e7..a4a328fce1a 100644 --- a/release/scripts/startup/bl_ui/properties_paint_common.py +++ b/release/scripts/startup/bl_ui/properties_paint_common.py @@ -943,8 +943,22 @@ def brush_settings_advanced(layout, context, brush, popover=False): # boundary edges/face sets automasking col.prop(brush, "use_automasking_boundary_edges", text="Mesh Boundary") col.prop(brush, "use_automasking_boundary_face_sets", text="Face Sets Boundary") + col.prop(brush, "use_automasking_cavity", text="Cavity") + col.prop(brush, "use_automasking_cavity_inverted", text="Cavity (Inverted)") + + col.separator() col.prop(brush, "automasking_boundary_edges_propagation_steps") + if brush.use_automasking_cavity or brush.use_automasking_cavity_inverted: + col.separator() + + col.prop(brush, "automasking_cavity_factor", text="Cavity Factor") + col.prop(brush, "automasking_cavity_blur_steps", text="Cavity Blur") + col.prop(brush, "use_automasking_custom_cavity_curve", text="Use Curve") + + if brush.use_automasking_custom_cavity_curve: + col.template_curve_mapping(brush, "automasking_cavity_curve") + layout.separator() # sculpt plane settings diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index 092fae671e0..fcf00ee80f6 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -3298,7 +3298,8 @@ class VIEW3D_MT_mask(Menu): layout.separator() - props = layout.operator("sculpt.dirty_mask", text='Dirty Mask') + props = layout.operator("sculpt.mask_from_cavity", text="Mask From Cavity") + props.use_automask_settings = False layout.separator() @@ -5494,6 +5495,8 @@ class VIEW3D_MT_sculpt_automasking_pie(Menu): pie.prop(sculpt, "use_automasking_face_sets", text="Face Sets") pie.prop(sculpt, "use_automasking_boundary_edges", text="Mesh Boundary") pie.prop(sculpt, "use_automasking_boundary_face_sets", text="Face Sets Boundary") + pie.prop(sculpt, "use_automasking_cavity", text="Cavity") + pie.prop(sculpt, "use_automasking_cavity_inverted", text="Cavity (Inverted)") class VIEW3D_MT_sculpt_face_sets_edit_pie(Menu): diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py index 12e05840cfa..153bce78ec2 100644 --- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py +++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py @@ -1,5 +1,5 @@ # SPDX-License-Identifier: GPL-2.0-or-later -from bpy.types import Menu, Panel, UIList +from bpy.types import Menu, Panel, UIList, WindowManager from bl_ui.properties_grease_pencil_common import ( GreasePencilSculptAdvancedPanel, GreasePencilDisplayPanel, @@ -939,7 +939,6 @@ class VIEW3D_PT_sculpt_voxel_remesh(Panel, View3DPaintPanel): layout.operator("object.voxel_remesh", text="Remesh") - # TODO, move to space_view3d.py class VIEW3D_PT_sculpt_options(Panel, View3DPaintPanel): bl_context = ".sculpt_mode" # dot on purpose (access from topbar) @@ -967,10 +966,33 @@ class VIEW3D_PT_sculpt_options(Panel, View3DPaintPanel): col.separator() col = layout.column(heading="Auto-Masking", align=True) + col.prop(sculpt, "use_automasking_topology", text="Topology") col.prop(sculpt, "use_automasking_face_sets", text="Face Sets") col.prop(sculpt, "use_automasking_boundary_edges", text="Mesh Boundary") col.prop(sculpt, "use_automasking_boundary_face_sets", text="Face Sets Boundary") + col.prop(sculpt, "use_automasking_cavity", text="Cavity") + col.prop(sculpt, "use_automasking_cavity_inverted", text="Cavity (Inverted)") + + col.separator() + col.prop(sculpt.brush, "automasking_boundary_edges_propagation_steps") + + if sculpt.use_automasking_cavity or sculpt.use_automasking_cavity_inverted: + col.separator() + + col2 = col.column() + props = col2.operator("sculpt.mask_from_cavity", text="Mask From Cavity") + props.use_automask_settings = True + + col2 = col.column() + + col2.prop(sculpt, "automasking_cavity_factor", text="Cavity Factor") + col2.prop(sculpt, "automasking_cavity_blur_steps", text="Cavity Blur") + + col2.prop(sculpt, "use_automasking_custom_cavity_curve", text="Use Curve") + + if sculpt.use_automasking_custom_cavity_curve: + col2.template_curve_mapping(sculpt, "automasking_cavity_curve") class VIEW3D_PT_sculpt_options_gravity(Panel, View3DPaintPanel): |