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-02 16:11:35 +0300
committerHans Goudey <h.goudey@me.com>2021-06-02 16:11:35 +0300
commit21de669141dc8cde86eb8edfb18ab614c2b3109e (patch)
treebac9ba578be813a9195c21d73ec490a36c9220de /source/blender/blenkernel/intern/spline_poly.cc
parent5b176b66da1f85f19e042f69dc302e8e72e0dc44 (diff)
Splines: Function to copy spline settings without data
Often you need to copy a spline to do an operation, but don't want to manually copy over all of the settings. I've already forgotten to do it once anyway. These functions copy a spline's "settings" into a new spline, but not the data. I tried to avoid duplicating any copying so this is easier to extend in the future. Differential Revision: https://developer.blender.org/D11463
Diffstat (limited to 'source/blender/blenkernel/intern/spline_poly.cc')
-rw-r--r--source/blender/blenkernel/intern/spline_poly.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/spline_poly.cc b/source/blender/blenkernel/intern/spline_poly.cc
index 5c33b0052fc..5f8e81d5ad0 100644
--- a/source/blender/blenkernel/intern/spline_poly.cc
+++ b/source/blender/blenkernel/intern/spline_poly.cc
@@ -28,6 +28,13 @@ SplinePtr PolySpline::copy() const
return std::make_unique<PolySpline>(*this);
}
+SplinePtr PolySpline::copy_settings() const
+{
+ std::unique_ptr<PolySpline> copy = std::make_unique<PolySpline>();
+ copy_base_settings(*this, *copy);
+ return copy;
+}
+
int PolySpline::size() const
{
const int size = positions_.size();