Commit: 59b777eedd23d34a7d723a7b73032d463077f1b3
Author: Jesse Yurkovich
Date:   Thu Feb 3 22:39:57 2022 +1100
Branches: blender-v3.1-release
https://developer.blender.org/rB59b777eedd23d34a7d723a7b73032d463077f1b3

Fix T95137: Spline calc_length not working with just 1 NURB point

The NURB case did not properly handle a curve with only 1 point.

Ref D13904

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

M       source/blender/blenkernel/intern/curve.cc

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

diff --git a/source/blender/blenkernel/intern/curve.cc 
b/source/blender/blenkernel/intern/curve.cc
index 70edaccb244..dda2b5076a8 100644
--- a/source/blender/blenkernel/intern/curve.cc
+++ b/source/blender/blenkernel/intern/curve.cc
@@ -899,7 +899,7 @@ float BKE_nurb_calc_length(const Nurb *nu, int resolution)
         pntsit = points + 3;
       }
 
-      while (--b) {
+      while (--b > 0) {
         length += len_v3v3(prevpntsit, pntsit);
         prevpntsit = pntsit;
         pntsit += 3;

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to