diff options
author | Hans Goudey <h.goudey@me.com> | 2022-03-30 04:11:38 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-03-30 04:11:38 +0300 |
commit | f4f89a76a8f4ca77bc59c9572cd2aab6da1e9023 (patch) | |
tree | 8633173b659decf46f0a5911b66016c1ff738357 /source/blender/blenkernel/BKE_curves.hh | |
parent | 87e9451d660e8288d70aa781530b69f4005bf0ea (diff) |
Curves: Port parameter node to the new data-block
Using the evaluated lengths cache from 72d25fa41d8c575, re-implement
the curve parameter node with the new data structure. Conceptually
it works the same way, but the code is restructured and cleaned up
a bit as well. This also adds support for Catmull Rom curves.
Differential Revision: https://developer.blender.org/D14461
Diffstat (limited to 'source/blender/blenkernel/BKE_curves.hh')
-rw-r--r-- | source/blender/blenkernel/BKE_curves.hh | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_curves.hh b/source/blender/blenkernel/BKE_curves.hh index 13b3d280bc7..29cf38421d1 100644 --- a/source/blender/blenkernel/BKE_curves.hh +++ b/source/blender/blenkernel/BKE_curves.hh @@ -273,6 +273,12 @@ class CurvesGeometry : public ::CurvesGeometry { /** Makes sure the data described by #evaluated_offsets if necessary. */ void ensure_evaluated_offsets() const; + /** + * Retrieve offsets into a Bezier curve's avaluated points for each control point. + * Call #ensure_evaluated_offsets() first to ensure that the evaluated offsets cache is current. + */ + Span<int> bezier_evaluated_offsets_for_curve(int curve_index) const; + Span<float3> evaluated_positions() const; /** @@ -285,6 +291,7 @@ class CurvesGeometry : public ::CurvesGeometry { * but is passed for performance reasons to avoid looking up the attribute. */ Span<float> evaluated_lengths_for_curve(int curve_index, bool cyclic) const; + float evaluated_length_total_for_curve(int curve_index, bool cyclic) const; /** Calculates the data described by #evaluated_lengths_for_curve if necessary. */ void ensure_evaluated_lengths() const; |