From baf84f1ec9d1e5a8317bedb86f90dd4c7542bb4d Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Fri, 14 Jun 2024 19:38:51 -0400 Subject: [PATCH] Cleanup: Sculpt: Remove unused vertex indices argument --- source/blender/editors/sculpt_paint/brushes/draw.cc | 2 +- .../sculpt_paint/brushes/draw_vector_displacement.cc | 2 +- source/blender/editors/sculpt_paint/brushes/fill.cc | 2 +- source/blender/editors/sculpt_paint/brushes/flatten.cc | 2 +- source/blender/editors/sculpt_paint/brushes/inflate.cc | 2 +- source/blender/editors/sculpt_paint/brushes/mask.cc | 2 +- source/blender/editors/sculpt_paint/brushes/scrape.cc | 2 +- source/blender/editors/sculpt_paint/brushes/smooth.cc | 2 +- source/blender/editors/sculpt_paint/mesh_brush_common.hh | 1 - source/blender/editors/sculpt_paint/sculpt.cc | 6 ++---- 10 files changed, 10 insertions(+), 13 deletions(-) diff --git a/source/blender/editors/sculpt_paint/brushes/draw.cc b/source/blender/editors/sculpt_paint/brushes/draw.cc index 49219fb92aa..afd995f950d 100644 --- a/source/blender/editors/sculpt_paint/brushes/draw.cc +++ b/source/blender/editors/sculpt_paint/brushes/draw.cc @@ -63,7 +63,7 @@ static void calc_faces(const Sculpt &sd, const MutableSpan distances = tls.distances; calc_distance_falloff( ss, positions_eval, verts, eBrushFalloffShape(brush.falloff_shape), distances, factors); - calc_brush_strength_factors(ss, brush, verts, distances, factors); + calc_brush_strength_factors(ss, brush, distances, factors); if (ss.cache->automasking) { auto_mask::calc_vert_factors(object, *ss.cache->automasking, node, verts, factors); diff --git a/source/blender/editors/sculpt_paint/brushes/draw_vector_displacement.cc b/source/blender/editors/sculpt_paint/brushes/draw_vector_displacement.cc index b50ea5b02ef..bb9567b5d63 100644 --- a/source/blender/editors/sculpt_paint/brushes/draw_vector_displacement.cc +++ b/source/blender/editors/sculpt_paint/brushes/draw_vector_displacement.cc @@ -84,7 +84,7 @@ static void calc_faces(const Sculpt &sd, const MutableSpan distances = tls.distances; calc_distance_falloff( ss, positions_eval, verts, eBrushFalloffShape(brush.falloff_shape), distances, factors); - calc_brush_strength_factors(ss, brush, verts, distances, factors); + calc_brush_strength_factors(ss, brush, distances, factors); if (ss.cache->automasking) { auto_mask::calc_vert_factors(object, *ss.cache->automasking, node, verts, factors); diff --git a/source/blender/editors/sculpt_paint/brushes/fill.cc b/source/blender/editors/sculpt_paint/brushes/fill.cc index e00d1123fea..5c97cbe011d 100644 --- a/source/blender/editors/sculpt_paint/brushes/fill.cc +++ b/source/blender/editors/sculpt_paint/brushes/fill.cc @@ -65,7 +65,7 @@ static void calc_faces(const Sculpt &sd, const MutableSpan distances = tls.distances; calc_distance_falloff( ss, positions_eval, verts, eBrushFalloffShape(brush.falloff_shape), distances, factors); - calc_brush_strength_factors(ss, brush, verts, distances, factors); + calc_brush_strength_factors(ss, brush, distances, factors); if (ss.cache->automasking) { auto_mask::calc_vert_factors(object, *ss.cache->automasking, node, verts, factors); diff --git a/source/blender/editors/sculpt_paint/brushes/flatten.cc b/source/blender/editors/sculpt_paint/brushes/flatten.cc index db77507bc72..252531060a1 100644 --- a/source/blender/editors/sculpt_paint/brushes/flatten.cc +++ b/source/blender/editors/sculpt_paint/brushes/flatten.cc @@ -64,7 +64,7 @@ static void calc_faces(const Sculpt &sd, const MutableSpan distances = tls.distances; calc_distance_falloff( ss, positions_eval, verts, eBrushFalloffShape(brush.falloff_shape), distances, factors); - calc_brush_strength_factors(ss, brush, verts, distances, factors); + calc_brush_strength_factors(ss, brush, distances, factors); if (ss.cache->automasking) { auto_mask::calc_vert_factors(object, *ss.cache->automasking, node, verts, factors); diff --git a/source/blender/editors/sculpt_paint/brushes/inflate.cc b/source/blender/editors/sculpt_paint/brushes/inflate.cc index 8d433356461..5069f2e25ac 100644 --- a/source/blender/editors/sculpt_paint/brushes/inflate.cc +++ b/source/blender/editors/sculpt_paint/brushes/inflate.cc @@ -71,7 +71,7 @@ static void calc_faces(const Sculpt &sd, const MutableSpan distances = tls.distances; calc_distance_falloff( ss, positions_eval, verts, eBrushFalloffShape(brush.falloff_shape), distances, factors); - calc_brush_strength_factors(ss, brush, verts, distances, factors); + calc_brush_strength_factors(ss, brush, distances, factors); if (ss.cache->automasking) { auto_mask::calc_vert_factors(object, *ss.cache->automasking, node, verts, factors); diff --git a/source/blender/editors/sculpt_paint/brushes/mask.cc b/source/blender/editors/sculpt_paint/brushes/mask.cc index 5700060fd30..120c2a482f5 100644 --- a/source/blender/editors/sculpt_paint/brushes/mask.cc +++ b/source/blender/editors/sculpt_paint/brushes/mask.cc @@ -85,7 +85,7 @@ static void calc_faces(const Brush &brush, const MutableSpan distances = tls.distances; calc_distance_falloff( ss, positions, verts, eBrushFalloffShape(brush.falloff_shape), distances, factors); - calc_brush_strength_factors(ss, brush, verts, distances, factors); + calc_brush_strength_factors(ss, brush, distances, factors); if (ss.cache->automasking) { auto_mask::calc_vert_factors(object, *ss.cache->automasking, node, verts, factors); diff --git a/source/blender/editors/sculpt_paint/brushes/scrape.cc b/source/blender/editors/sculpt_paint/brushes/scrape.cc index f4a47bb848a..ac6024a5177 100644 --- a/source/blender/editors/sculpt_paint/brushes/scrape.cc +++ b/source/blender/editors/sculpt_paint/brushes/scrape.cc @@ -65,7 +65,7 @@ static void calc_faces(const Sculpt &sd, const MutableSpan distances = tls.distances; calc_distance_falloff( ss, positions_eval, verts, eBrushFalloffShape(brush.falloff_shape), distances, factors); - calc_brush_strength_factors(ss, brush, verts, distances, factors); + calc_brush_strength_factors(ss, brush, distances, factors); if (ss.cache->automasking) { auto_mask::calc_vert_factors(object, *ss.cache->automasking, node, verts, factors); diff --git a/source/blender/editors/sculpt_paint/brushes/smooth.cc b/source/blender/editors/sculpt_paint/brushes/smooth.cc index 92c7ba92610..785a4c719c5 100644 --- a/source/blender/editors/sculpt_paint/brushes/smooth.cc +++ b/source/blender/editors/sculpt_paint/brushes/smooth.cc @@ -130,7 +130,7 @@ BLI_NOINLINE static void apply_positions_faces(const Sculpt &sd, const MutableSpan distances = tls.distances; calc_distance_falloff( ss, positions_eval, verts, eBrushFalloffShape(brush.falloff_shape), distances, factors); - calc_brush_strength_factors(ss, brush, verts, distances, factors); + calc_brush_strength_factors(ss, brush, distances, factors); if (ss.cache->automasking) { auto_mask::calc_vert_factors(object, *ss.cache->automasking, node, verts, factors); diff --git a/source/blender/editors/sculpt_paint/mesh_brush_common.hh b/source/blender/editors/sculpt_paint/mesh_brush_common.hh index d57e84bb9a9..9c1c16ea035 100644 --- a/source/blender/editors/sculpt_paint/mesh_brush_common.hh +++ b/source/blender/editors/sculpt_paint/mesh_brush_common.hh @@ -88,7 +88,6 @@ void calc_distance_falloff(SculptSession &ss, */ void calc_brush_strength_factors(const SculptSession &ss, const Brush &brush, - Span vert_indices, Span distances, MutableSpan factors); diff --git a/source/blender/editors/sculpt_paint/sculpt.cc b/source/blender/editors/sculpt_paint/sculpt.cc index 0b3d86008cc..ce193b0e001 100644 --- a/source/blender/editors/sculpt_paint/sculpt.cc +++ b/source/blender/editors/sculpt_paint/sculpt.cc @@ -6594,16 +6594,14 @@ void calc_distance_falloff(SculptSession &ss, void calc_brush_strength_factors(const SculptSession &ss, const Brush &brush, - const Span verts, const Span distances, const MutableSpan factors) { - BLI_assert(verts.size() == distances.size()); - BLI_assert(verts.size() == factors.size()); + BLI_assert(factors.size() == distances.size()); const StrokeCache &cache = *ss.cache; - for (const int i : verts.index_range()) { + for (const int i : factors.index_range()) { if (factors[i] == 0.0f) { /* Skip already masked-out points, as they might be outside of the brush radius and be * unaffected anyway. Having such large values in the calculations below might lead to