[Bf-blender-cvs] [218f23935c5] master: Fix: Failed assert for evaluated lengths of single point curves

Hans Goudey noreply at git.blender.org
Sun May 29 13:43:28 CEST 2022


Commit: 218f23935c508d5d4248913d08c22925bb16df5a
Author: Hans Goudey
Date:   Sun May 29 13:43:25 2022 +0200
Branches: master
https://developer.blender.org/rB218f23935c508d5d4248913d08c22925bb16df5a

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.

===================================================================

M	source/blender/blenkernel/BKE_curves.hh

===================================================================

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();
 }



More information about the Bf-blender-cvs mailing list