diff options
author | Pablo Dobarro <pablodp606@gmail.com> | 2020-03-09 21:04:37 +0300 |
---|---|---|
committer | Pablo Dobarro <pablodp606@gmail.com> | 2020-03-09 21:43:00 +0300 |
commit | e702c9a7000bf4096546b876ae6a926acaa8d6ec (patch) | |
tree | 647cec9997e15e6e52a4da7b6a65dbcfcbce1c33 /source/blender/editors/sculpt_paint/sculpt_cloth.c | |
parent | 0030e6a2fc265258be7e02bedb89d81feda2adda (diff) |
Fix Cloth Brush not working with automasking
The cloth brush was not using the automasking values when calculating
the mask value on each vertex.
Reviewed By: brecht
Differential Revision: https://developer.blender.org/D7083
Diffstat (limited to 'source/blender/editors/sculpt_paint/sculpt_cloth.c')
-rw-r--r-- | source/blender/editors/sculpt_paint/sculpt_cloth.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/source/blender/editors/sculpt_paint/sculpt_cloth.c b/source/blender/editors/sculpt_paint/sculpt_cloth.c index 07a4dab926e..431f95d5509 100644 --- a/source/blender/editors/sculpt_paint/sculpt_cloth.c +++ b/source/blender/editors/sculpt_paint/sculpt_cloth.c @@ -384,7 +384,8 @@ static void do_cloth_brush_solve_simulation_task_cb_ex( sub_v3_v3v3(pos_diff, cloth_sim->pos[i], cloth_sim->prev_pos[i]); mul_v3_fl(pos_diff, (1.0f - cloth_sim->damping)); - const float mask_v = (1.0f - (vd.mask ? *vd.mask : 0.0f)); + const float mask_v = (1.0f - (vd.mask ? *vd.mask : 0.0f)) * + SCULPT_automasking_factor_get(ss, vd.index); madd_v3_v3fl(cloth_sim->pos[i], pos_diff, mask_v); madd_v3_v3fl(cloth_sim->pos[i], cloth_sim->acceleration[i], mask_v); @@ -448,8 +449,10 @@ static void cloth_brush_satisfy_constraints(SculptSession *ss, mul_v3_v3fl(correction_vector, v1_to_v2, 1.0f - (constraint_distance / current_distance)); mul_v3_v3fl(correction_vector_half, correction_vector, 0.5f); - const float mask_v1 = (1.0f - SCULPT_vertex_mask_get(ss, v1)); - const float mask_v2 = (1.0f - SCULPT_vertex_mask_get(ss, v2)); + const float mask_v1 = (1.0f - SCULPT_vertex_mask_get(ss, v1)) * + SCULPT_automasking_factor_get(ss, v1); + const float mask_v2 = (1.0f - SCULPT_vertex_mask_get(ss, v2)) * + SCULPT_automasking_factor_get(ss, v2); const float sim_factor_v1 = cloth_brush_simulation_falloff_get( brush, ss->cache->radius, ss->cache->initial_location, cloth_sim->init_pos[v1]); |