diff options
author | Pablo Dobarro <pablodp606@gmail.com> | 2020-10-15 20:34:54 +0300 |
---|---|---|
committer | Pablo Dobarro <pablodp606@gmail.com> | 2020-10-15 20:35:37 +0300 |
commit | 6fe3521481b26ad6b6411b0863dfcd4ac2a81132 (patch) | |
tree | 31339c1ed545b1fa923ef8ec8fc1a3b5072b4144 /source/blender/editors/sculpt_paint/sculpt.c | |
parent | da7ace00d5fb534d8583c0b70497d7819bc7b273 (diff) |
Sculpt: Add global automasking settings support in filters
When using the sculpt filters, global automasking settings that affect
all brushes were ignored because the automasking system was not
implemented for filters, making filters and brushes react differently
to the global sculpt settings which creates confusion.
This makes all filter tools (mesh, cloth, color) use the same general
automasking settings and features as the brush tools. Filters will now
use the settings in the options panel to limit their effect.
This also removes the "use Face Sets" option from the Mesh filter code,
as it was duplicated from the automasking code just to have that
funcitonality. This is now handled by the regular automasking system.
The "Use Face Sets" option is still available in the cloth filter as that
option limits the action of the forces, not the displacement.
After this, it is possible to initialize the automasking system
independently from the StrokeCache and Brush settings, so it can also be
added to more tools and features in the future.
Fixes T81619
Reviewed By: dbystedt, sergey
Maniphest Tasks: T81619
Differential Revision: https://developer.blender.org/D9171
Diffstat (limited to 'source/blender/editors/sculpt_paint/sculpt.c')
-rw-r--r-- | source/blender/editors/sculpt_paint/sculpt.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index 8a9d1bba92c..4e15728b081 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -2506,7 +2506,7 @@ float SCULPT_brush_strength_factor(SculptSession *ss, avg *= 1.0f - mask; /* Auto-masking. */ - avg *= SCULPT_automasking_factor_get(ss, vertex_index); + avg *= SCULPT_automasking_factor_get(cache->automasking, ss, vertex_index); return avg; } @@ -3908,7 +3908,7 @@ static void do_elastic_deform_brush_task_cb_ex(void *__restrict userdata, mul_v3_fl(final_disp, 1.0f - *vd.mask); } - mul_v3_fl(final_disp, SCULPT_automasking_factor_get(ss, vd.index)); + mul_v3_fl(final_disp, SCULPT_automasking_factor_get(ss->cache->automasking, ss, vd.index)); copy_v3_v3(proxy[vd.i], final_disp); @@ -5760,7 +5760,7 @@ static void do_brush_action(Sculpt *sd, Object *ob, Brush *brush, UnifiedPaintSe if (SCULPT_stroke_is_first_brush_step(ss->cache)) { if (SCULPT_is_automasking_enabled(sd, ss, brush)) { - SCULPT_automasking_init(sd, ob); + ss->cache->automasking = SCULPT_automasking_cache_init(sd, brush, ob); } } @@ -7764,7 +7764,7 @@ static void sculpt_stroke_done(const bContext *C, struct PaintStroke *UNUSED(str } if (SCULPT_is_automasking_enabled(sd, ss, brush)) { - SCULPT_automasking_end(ob); + SCULPT_automasking_cache_free(ss->cache->automasking); } BKE_pbvh_node_color_buffer_free(ss->pbvh); |