diff options
author | Johnny Matthews <guitargeek> | 2021-09-15 21:57:01 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2021-09-15 21:57:01 +0300 |
commit | 231948f33f8f3e79f7ae38ab9b3db3e597f13b4a (patch) | |
tree | b0f47890380d5a48d10f697e33cbb5465aeb2be9 /source/blender/blenkernel/intern/spline_nurbs.cc | |
parent | a866a32ff257fd9ff4d543adbddad283a189bbc6 (diff) |
Splines: Add a method for reversing a Spline
This moved the spline reversing logic out of the Curve Reverse geometry
node and into the spline class. This allows a spline to reverse itself
with a call to `my_spline.reverse()`
The base class will reverse position, radii & tilt, while specialized
versions are created for Bezier and Nurbs splines to reverse the
additional data that these classes encapsulate.
Differential Revision: https://developer.blender.org/D12501
Diffstat (limited to 'source/blender/blenkernel/intern/spline_nurbs.cc')
-rw-r--r-- | source/blender/blenkernel/intern/spline_nurbs.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/spline_nurbs.cc b/source/blender/blenkernel/intern/spline_nurbs.cc index ac6f1bd082c..6d30d8ba916 100644 --- a/source/blender/blenkernel/intern/spline_nurbs.cc +++ b/source/blender/blenkernel/intern/spline_nurbs.cc @@ -142,6 +142,11 @@ Span<float> NURBSpline::weights() const return weights_; } +void NURBSpline::reverse_impl() +{ + this->weights().reverse(); +} + void NURBSpline::mark_cache_invalid() { basis_cache_dirty_ = true; |