Fix #140078: Sculpt Paint brushes can apply NaN

Introduced with 23951e1b12

The paint brush uses either absolute or local distance values, mapping
this distance to a brush strength requires using different values for
`BKE_brush_calc_curve_factors` and cannot just use
`calc_brush_strength_factors`. To fix this, use the more generic method
instead to allow passing the correct radius.

Pull Request: https://projects.blender.org/blender/blender/pulls/140084
This commit is contained in:
Sean Kim
2025-06-10 01:46:09 +02:00
committed by Sean Kim
parent 1131254644
commit 44bfeb2214

View File

@@ -401,7 +401,8 @@ static void do_paint_brush_task(const Scene &scene,
}
filter_distances_with_radius(radius, distances, factors);
apply_hardness_to_distances(radius, cache.hardness, distances);
calc_brush_strength_factors(cache, brush, distances, factors);
BKE_brush_calc_curve_factors(
eBrushCurvePreset(brush.curve_preset), brush.curve, distances, radius, factors);
MutableSpan<float> auto_mask;
if (cache.automasking) {