Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacques Lucke <jacques@blender.org>2022-09-29 14:32:03 +0300
committerJacques Lucke <jacques@blender.org>2022-09-29 14:32:03 +0300
commitb70b02ee429d323a83c2e90e189a753bcabe0bf5 (patch)
tree697173a8ac830a7431052539399e65e1d81936b1 /source/blender/nodes/geometry/nodes/node_geo_curve_spline_parameter.cc
parentffccdf069b24eb277f7b4507c8dd4fa2b7c74142 (diff)
Fix: Spline Parameter node produces NaN when curve is a single point
Issue found in file from T101256.
Diffstat (limited to 'source/blender/nodes/geometry/nodes/node_geo_curve_spline_parameter.cc')
-rw-r--r--source/blender/nodes/geometry/nodes/node_geo_curve_spline_parameter.cc4
1 files changed, 4 insertions, 0 deletions
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 6fe806adb7c..00d3129a63d 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