Commit: 036c60a27d8d2d66d9cf81c131c6c94548ba51c6
Author: Jacques Lucke
Date:   Thu Sep 29 13:32:03 2022 +0200
Branches: blender-v3.3-release
https://developer.blender.org/rB036c60a27d8d2d66d9cf81c131c6c94548ba51c6

Fix: Spline Parameter node produces NaN when curve is a single point

Issue found in file from T101256.

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

M       source/blender/nodes/geometry/nodes/node_geo_curve_spline_parameter.cc

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

diff --git 
a/source/blender/nodes/geometry/nodes/node_geo_curve_spline_parameter.cc 
b/source/blender/nodes/geometry/nodes/node_geo_curve_spline_parameter.cc
index 5901d310df4..03f5e428fb3 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_curve_spline_parameter.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_curve_spline_parameter.cc
@@ -126,6 +126,10 @@ static VArray<float> 
construct_curve_parameter_varray(const bke::CurvesGeometry
             value *= factor;
           }
         }
+        else if (curve_lengths.size() == 1) {
+          /* The curve is a single point. */
+          curve_lengths[0] = 0.0f;
+        }
         else {
           /* It is arbitrary what to do in those rare cases when all the 
points are
            * in the same position. In this case we are just arbitrarily giving 
a valid

_______________________________________________
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