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 /source/blender/blenkernel/BKE_paint.h | |
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 'source/blender/blenkernel/BKE_paint.h')
-rw-r--r-- | source/blender/blenkernel/BKE_paint.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_paint.h b/source/blender/blenkernel/BKE_paint.h index ed0969a6306..386fecfd278 100644 --- a/source/blender/blenkernel/BKE_paint.h +++ b/source/blender/blenkernel/BKE_paint.h @@ -52,6 +52,7 @@ struct Palette; struct PaletteColor; struct Scene; struct StrokeCache; +struct Sculpt; struct SubdivCCG; struct Tex; struct ToolSettings; @@ -473,6 +474,11 @@ typedef struct SculptBoundary { } twist; } SculptBoundary; +typedef struct CavityMaskData { + float factor; + int stroke_id; +} CavityMaskData; + typedef struct SculptFakeNeighbors { bool use_fake_neighbors; @@ -552,6 +558,9 @@ typedef struct SculptAttributePointers { /* BMesh */ SculptAttribute *dyntopo_node_id_vertex; SculptAttribute *dyntopo_node_id_face; + + SculptAttribute *stroke_id; + SculptAttribute *cavity; } SculptAttributePointers; typedef struct SculptSession { @@ -743,6 +752,9 @@ typedef struct SculptSession { */ char *last_paint_canvas_key; + uchar stroke_id; + int last_automasking_settings_hash; + uchar last_cavity_stroke_id; } SculptSession; void BKE_sculptsession_free(struct Object *ob); @@ -900,6 +912,8 @@ bool BKE_paint_canvas_image_get(struct PaintModeSettings *settings, struct ImageUser **r_image_user); int BKE_paint_canvas_uvmap_layer_index_get(const struct PaintModeSettings *settings, struct Object *ob); +void BKE_sculpt_check_cavity_curves(struct Sculpt *sd); +struct CurveMapping *BKE_sculpt_default_cavity_curve(void); #ifdef __cplusplus } |