diff options
author | Philipp Oeser <info@graphics-engineer.com> | 2020-12-16 21:00:12 +0300 |
---|---|---|
committer | Philipp Oeser <info@graphics-engineer.com> | 2020-12-16 23:36:15 +0300 |
commit | 07c46154318e321fe76c818c357439b79ea982cc (patch) | |
tree | c890e5144c58ff1b8a777c70120287abe54bf76f | |
parent | 247b10e6a25ba58e8a74c64d4890a4c4885e51d0 (diff) |
Fix T83856: Sculpt: anchored brushes with spherical falloff ignore topology automasking
Anchored brushes with spherical falloff start off with zero radius, thus
we have no pbvh nodes on the first brush step. This would prevent
initializing the automasking cache [which only happens on the first brush
step].
Maniphest Tasks: T83856
Differential Revision: https://developer.blender.org/D9873
-rw-r--r-- | source/blender/editors/sculpt_paint/sculpt.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index 26db2673335..38d2bed7d97 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -5923,6 +5923,17 @@ static void do_brush_action(Sculpt *sd, Object *ob, Brush *brush, UnifiedPaintSe } } + /* Initialize automasking cache. For anchored brushes with spherical falloff, we start off with + * zero radius, thus we have no pbvh nodes on the first brush step. */ + if (totnode || + ((brush->falloff_shape == PAINT_FALLOFF_SHAPE_SPHERE) && (brush->flag & BRUSH_ANCHORED))) { + if (SCULPT_stroke_is_first_brush_step(ss->cache)) { + if (SCULPT_is_automasking_enabled(sd, ss, brush)) { + ss->cache->automasking = SCULPT_automasking_cache_init(sd, brush, ob); + } + } + } + /* Only act if some verts are inside the brush area. */ if (totnode) { float location[3]; @@ -5946,12 +5957,6 @@ static void do_brush_action(Sculpt *sd, Object *ob, Brush *brush, UnifiedPaintSe update_brush_local_mat(sd, ob); } - if (SCULPT_stroke_is_first_brush_step(ss->cache)) { - if (SCULPT_is_automasking_enabled(sd, ss, brush)) { - ss->cache->automasking = SCULPT_automasking_cache_init(sd, brush, ob); - } - } - if (brush->sculpt_tool == SCULPT_TOOL_POSE && SCULPT_stroke_is_first_brush_step(ss->cache)) { SCULPT_pose_brush_init(sd, ob, ss, brush); } |