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
This commit is contained in:
Sean Kim
2024-08-04 18:28:30 +02:00
committed by Sean Kim
parent be4c7cae7c
commit dd905de795

View File

@@ -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<float3> 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);
}