diff options
author | Hans Goudey <h.goudey@me.com> | 2022-04-07 00:30:27 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-04-07 00:30:27 +0300 |
commit | 8551e890687de7185388eed9e77171b0df7943a3 (patch) | |
tree | 7833056784792f3a46ac8fb6bd9776f3ced33367 /source/blender/editors/sculpt_paint/curves_sculpt_grow_shrink.cc | |
parent | 8b04308953adae983562026a2aa7bbd38e74174d (diff) |
Curves: Name mutable data retrieval functions explicitly
Add "for_write" on function names that retrieve mutable data arrays.
Though this makes function names longer, it's likely worth it because
it allows more easily using the const functions in a non-const context,
and reduces cases of mistakenly retrieving with edit access.
In the long term, this situation might change more if we implement
attributes storage that is accessible directly on `CurvesGeometry`
without duplicating the attribute API on geometry components,
which is currently the rough plan.
Differential Revision: https://developer.blender.org/D14562
Diffstat (limited to 'source/blender/editors/sculpt_paint/curves_sculpt_grow_shrink.cc')
-rw-r--r-- | source/blender/editors/sculpt_paint/curves_sculpt_grow_shrink.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/editors/sculpt_paint/curves_sculpt_grow_shrink.cc b/source/blender/editors/sculpt_paint/curves_sculpt_grow_shrink.cc index 230da61c95b..7cc5e524c30 100644 --- a/source/blender/editors/sculpt_paint/curves_sculpt_grow_shrink.cc +++ b/source/blender/editors/sculpt_paint/curves_sculpt_grow_shrink.cc @@ -79,7 +79,7 @@ class ShrinkCurvesEffect : public CurvesEffect { const Span<int> curve_indices, const Span<float> move_distances_cu) override { - MutableSpan<float3> positions_cu = curves.positions(); + MutableSpan<float3> positions_cu = curves.positions_for_write(); threading::parallel_for(curve_indices.index_range(), 256, [&](const IndexRange range) { for (const int influence_i : range) { const int curve_i = curve_indices[influence_i]; @@ -132,7 +132,7 @@ class ExtrapolateCurvesEffect : public CurvesEffect { const Span<int> curve_indices, const Span<float> move_distances_cu) override { - MutableSpan<float3> positions_cu = curves.positions(); + MutableSpan<float3> positions_cu = curves.positions_for_write(); threading::parallel_for(curve_indices.index_range(), 256, [&](const IndexRange range) { for (const int influence_i : range) { const int curve_i = curve_indices[influence_i]; @@ -214,7 +214,7 @@ class ScaleCurvesEffect : public CurvesEffect { const Span<int> curve_indices, const Span<float> move_distances_cu) override { - MutableSpan<float3> positions_cu = curves.positions(); + MutableSpan<float3> positions_cu = curves.positions_for_write(); threading::parallel_for(curve_indices.index_range(), 256, [&](const IndexRange range) { for (const int influence_i : range) { const int curve_i = curve_indices[influence_i]; |