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

Issue found in file from T101256.
This commit is contained in:
Jacques Lucke
2022-09-29 13:32:03 +02:00
parent ffccdf069b
commit b70b02ee42

View File

@@ -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