Fix T100258: wrong spline length used in Spline Parameter node

Differential Revision: https://developer.blender.org/D15705
This commit is contained in:
Iliya Katueshenock 2022-08-22 16:30:18 +02:00 committed by Jacques Lucke
parent 8265d08e7f
commit 5fff6c419c
Notes: blender-bot 2023-02-13 14:46:07 +01:00
Referenced by issue #100258, Regression: Geometry Nodes > Spline Parameter > Factor Output
1 changed files with 2 additions and 2 deletions

View File

@ -143,8 +143,8 @@ static VArray<float> construct_curve_parameter_varray(const bke::CurvesGeometry
Array<float> lengths = accumulated_lengths_curve_domain(curves);
const int last_index = curves.curves_num() - 1;
const int total_length = lengths.last() + curves.evaluated_length_total_for_curve(
last_index, cyclic[last_index]);
const float total_length = lengths.last() + curves.evaluated_length_total_for_curve(
last_index, cyclic[last_index]);
if (total_length > 0.0f) {
const float factor = 1.0f / total_length;
for (float &value : lengths) {