diff options
author | Hans Goudey <h.goudey@me.com> | 2022-05-29 14:43:25 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-05-29 14:43:25 +0300 |
commit | 218f23935c508d5d4248913d08c22925bb16df5a (patch) | |
tree | 4021c2909826b0cdf9d57169ed5d35c0fb6ade21 /source | |
parent | 86cfc30aac3c753416b4e389401f781252bd44ed (diff) |
Fix: Failed assert for evaluated lengths of single point curves
Since 2d80f814cc249d26b01f, curves always have evaluated points,
but single point curves do no have any evaluated segments, and the
leading zero length isn't stored in the curves length cache.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/BKE_curves.hh | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_curves.hh b/source/blender/blenkernel/BKE_curves.hh index 87fa26a4f73..153a1c6a1f4 100644 --- a/source/blender/blenkernel/BKE_curves.hh +++ b/source/blender/blenkernel/BKE_curves.hh @@ -785,6 +785,9 @@ inline float CurvesGeometry::evaluated_length_total_for_curve(const int curve_in const bool cyclic) const { const Span<float> lengths = this->evaluated_lengths_for_curve(curve_index, cyclic); + if (lengths.is_empty()) { + return 0.0f; + } return lengths.last(); } |