diff --git a/source/blender/blenkernel/intern/geometry_component_curve.cc b/source/blender/blenkernel/intern/geometry_component_curve.cc index e4417276243..b0d2d661cd5 100644 --- a/source/blender/blenkernel/intern/geometry_component_curve.cc +++ b/source/blender/blenkernel/intern/geometry_component_curve.cc @@ -294,21 +294,6 @@ static GVMutableArrayPtr make_cyclic_write_attribute(CurveEval &curve) * array implementations try to make it workable in common situations. * \{ */ -static Array control_point_offsets(const CurveEval &curve) -{ - Span splines = curve.splines(); - Array offsets(splines.size() + 1); - - int size = 0; - for (const int spline_index : splines.index_range()) { - offsets[spline_index] = size; - size += splines[spline_index]->size(); - } - offsets.last() = size; - - return offsets; -} - namespace { struct PointIndices { int spline_index; @@ -590,7 +575,7 @@ template class BuiltinPointAttributeProvider : public BuiltinAttribu return std::make_unique(get_span_(*splines.first())); } - Array offsets = control_point_offsets(*curve); + Array offsets = curve->control_point_offsets(); Array> spans(splines.size()); for (const int i : splines.index_range()) { spans[i] = get_span_(*splines[i]); @@ -613,7 +598,7 @@ template class BuiltinPointAttributeProvider : public BuiltinAttribu get_mutable_span_(*splines.first())); } - Array offsets = control_point_offsets(*curve); + Array offsets = curve->control_point_offsets(); Array> spans(splines.size()); for (const int i : splines.index_range()) { spans[i] = get_mutable_span_(*splines[i]); @@ -688,7 +673,7 @@ class PositionAttributeProvider final : public BuiltinPointAttributeProvidermark_cache_invalid(); } - Array offsets = control_point_offsets(*curve); + Array offsets = curve->control_point_offsets(); return std::make_unique< fn::GVMutableArray_For_EmbeddedVMutableArray>( offsets.last(), curve->splines(), std::move(offsets));