diff options
author | Jacques Lucke <jacques@blender.org> | 2022-08-19 17:24:24 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2022-08-19 17:24:24 +0300 |
commit | 16084066009ed954761b7652edd926c00733a437 (patch) | |
tree | 3cf0a2c53525a7aca4eeddf9013de1fa27b99544 /source/blender/blenkernel | |
parent | 188f7585a1838387c278780d743e5540a0c75a2c (diff) |
Fix: nurbs basis cache not computed before it is used
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/BKE_curves.hh | 4 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/curves_geometry.cc | 6 |
2 files changed, 9 insertions, 1 deletions
diff --git a/source/blender/blenkernel/BKE_curves.hh b/source/blender/blenkernel/BKE_curves.hh index 568899721a9..2b9b13d1d2b 100644 --- a/source/blender/blenkernel/BKE_curves.hh +++ b/source/blender/blenkernel/BKE_curves.hh @@ -338,12 +338,14 @@ class CurvesGeometry : public ::CurvesGeometry { /** Calculates the data described by #evaluated_lengths_for_curve if necessary. */ void ensure_evaluated_lengths() const; + void ensure_can_interpolate_to_evaluated() const; + /** * Evaluate a generic data to the standard evaluated points of a specific curve, * defined by the resolution attribute or other factors, depending on the curve type. * * \warning This function expects offsets to the evaluated points for each curve to be - * calculated. That can be ensured with #ensure_evaluated_offsets. + * calculated. That can be ensured with #ensure_can_interpolate_to_evaluated. */ void interpolate_to_evaluated(int curve_index, GSpan src, GMutableSpan dst) const; /** diff --git a/source/blender/blenkernel/intern/curves_geometry.cc b/source/blender/blenkernel/intern/curves_geometry.cc index 6486be4afe0..ef4a4ee1d6b 100644 --- a/source/blender/blenkernel/intern/curves_geometry.cc +++ b/source/blender/blenkernel/intern/curves_geometry.cc @@ -938,6 +938,12 @@ void CurvesGeometry::ensure_evaluated_lengths() const this->runtime->length_cache_dirty = false; } +void CurvesGeometry::ensure_can_interpolate_to_evaluated() const +{ + this->ensure_evaluated_offsets(); + this->ensure_nurbs_basis_cache(); +} + /** \} */ /* -------------------------------------------------------------------- */ |