diff options
author | Hans Goudey <h.goudey@me.com> | 2022-05-09 18:33:30 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-05-09 18:33:41 +0300 |
commit | e0e95f789576fec43550ef8aae8ae94151f7967f (patch) | |
tree | 3b01c42c23582c29fe10d31b7f7db6ca9d18145e /source/blender/blenkernel | |
parent | 9f8f35008ca907ea9a9511aff811452fb25fc560 (diff) |
Refactor: Move resample curves code to the geometry module
This commit moves the code for the resample curves node to the geometry
module, to allow reusing it in any editor. Split from D14870.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/BKE_curves.hh | 1 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/curves.cc | 7 |
2 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_curves.hh b/source/blender/blenkernel/BKE_curves.hh index bf2d50f63be..8ef7d2811b1 100644 --- a/source/blender/blenkernel/BKE_curves.hh +++ b/source/blender/blenkernel/BKE_curves.hh @@ -671,6 +671,7 @@ void interpolate_to_evaluated(const BasisCache &basis_cache, } // namespace curves Curves *curves_new_nomain(int points_num, int curves_num); +Curves *curves_new_nomain(CurvesGeometry curves); /** * Create a new curves data-block containing a single curve with the given length and type. diff --git a/source/blender/blenkernel/intern/curves.cc b/source/blender/blenkernel/intern/curves.cc index 1df1492bac1..bcfd6206a78 100644 --- a/source/blender/blenkernel/intern/curves.cc +++ b/source/blender/blenkernel/intern/curves.cc @@ -379,4 +379,11 @@ Curves *curves_new_nomain_single(const int points_num, const CurveType type) return curves; } +Curves *curves_new_nomain(CurvesGeometry curves) +{ + Curves *curves_id = static_cast<Curves *>(BKE_id_new_nomain(ID_CV, nullptr)); + bke::CurvesGeometry::wrap(curves_id->geometry) = std::move(curves); + return curves_id; +} + } // namespace blender::bke |