From dd905de795067050751b7d547a668719036dd2b4 Mon Sep 17 00:00:00 2001 From: Sean Kim Date: Sun, 4 Aug 2024 18:28:30 +0200 Subject: [PATCH] Fix #125838: Elastic deform brush does not respect mask values Factor calculation was not being used to scale the final translation. Also removes a seemingly mistakenly added texture calculation for the grids PBVH type. Pull Request: https://projects.blender.org/blender/blender/pulls/125849 --- .../editors/sculpt_paint/brushes/elastic_deform.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/source/blender/editors/sculpt_paint/brushes/elastic_deform.cc b/source/blender/editors/sculpt_paint/brushes/elastic_deform.cc index f7133a2bad8..433bf38ab78 100644 --- a/source/blender/editors/sculpt_paint/brushes/elastic_deform.cc +++ b/source/blender/editors/sculpt_paint/brushes/elastic_deform.cc @@ -115,6 +115,8 @@ static void calc_faces(const Sculpt &sd, calc_translations( brush, cache, kelvinet_params, cache.location, offset, orig_data.positions, translations); + scale_translations(translations, factors); + write_translations(sd, object, positions_eval, verts, translations, positions_orig); } @@ -144,13 +146,13 @@ static void calc_grids(const Sculpt &sd, auto_mask::calc_grids_factors(object, *cache.automasking, node, grids, factors); } - calc_brush_texture_factors(ss, brush, orig_data.positions, factors); - tls.translations.resize(grid_verts_num); const MutableSpan translations = tls.translations; calc_translations( brush, cache, kelvinet_params, cache.location, offset, orig_data.positions, translations); + scale_translations(translations, factors); + clip_and_lock_translations(sd, ss, orig_data.positions, translations); apply_translations(translations, grids, subdiv_ccg); } @@ -186,6 +188,8 @@ static void calc_bmesh(const Sculpt &sd, calc_translations( brush, cache, kelvinet_params, cache.location, offset, orig_positions, translations); + scale_translations(translations, factors); + clip_and_lock_translations(sd, ss, orig_positions, translations); apply_translations(translations, verts); }