Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Goudey <h.goudey@me.com>2021-06-16 00:24:11 +0300
committerHans Goudey <h.goudey@me.com>2021-06-16 00:24:11 +0300
commit732e8c723e5b677f371bfb6425986ac22386f93a (patch)
tree4cc4c56a12b86e6296ddb1fa87283956dafc2be7
parent6bb980b0f43721a5f87185cbac11d1bd0919a490 (diff)
Splines: Add resize method to CurveEval
This helps when adding splines to a new curve in parallel.
-rw-r--r--source/blender/blenkernel/BKE_spline.hh1
-rw-r--r--source/blender/blenkernel/intern/curve_eval.cc6
2 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_spline.hh b/source/blender/blenkernel/BKE_spline.hh
index dfbe82f31fd..ac970b23f14 100644
--- a/source/blender/blenkernel/BKE_spline.hh
+++ b/source/blender/blenkernel/BKE_spline.hh
@@ -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);
diff --git a/source/blender/blenkernel/intern/curve_eval.cc b/source/blender/blenkernel/intern/curve_eval.cc
index 9cafe1124b1..c9408cf4fcd 100644
--- a/source/blender/blenkernel/intern/curve_eval.cc
+++ b/source/blender/blenkernel/intern/curve_eval.cc
@@ -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.
*/