Splines: Add resize method to CurveEval

This helps when adding splines to a new curve in parallel.
This commit is contained in:
Hans Goudey 2021-06-15 16:24:11 -05:00
parent 6bb980b0f4
commit 732e8c723e
2 changed files with 7 additions and 0 deletions

View File

@ -535,6 +535,7 @@ struct CurveEval {
blender::Span<SplinePtr> splines() const;
blender::MutableSpan<SplinePtr> splines();
void resize(const int size);
void add_spline(SplinePtr spline);
void remove_splines(blender::IndexMask mask);

View File

@ -42,6 +42,12 @@ blender::MutableSpan<SplinePtr> CurveEval::splines()
return splines_;
}
void CurveEval::resize(const int size)
{
splines_.resize(size);
attributes.reallocate(size);
}
/**
* \warning Call #reallocate on the spline's attributes after adding all splines.
*/