From 66dda2b902f0e2d1ee4a6d956ae5144743f7df2d Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Tue, 8 Nov 2022 12:31:11 -0600 Subject: [PATCH] Fix T102003: Spline parameter length wrong for NURBS The node has always be a bit confusing for the NURBS case, since it uses the distance between control points since the evaluated/control point mapping isn't obvious, but it also went above 1, which wasn't correct. Instead, retrieve the total length from the point lengths calculated in the previous step. The results should be the same for other curve types. --- .../nodes/geometry/nodes/node_geo_curve_spline_parameter.cc | 3 +-- 1 file changed, 1 insertion(+), 2 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 3dc89a9058e..159a4661df0 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 @@ -117,9 +117,8 @@ static VArray construct_curve_parameter_varray(const bke::CurvesGeometry threading::parallel_for(curves.curves_range(), 1024, [&](IndexRange range) { for (const int i_curve : range) { - const float total_length = curves.evaluated_length_total_for_curve(i_curve, - cyclic[i_curve]); MutableSpan curve_lengths = lengths.slice(curves.points_for_curve(i_curve)); + const float total_length = curve_lengths.last(); if (total_length > 0.0f) { const float factor = 1.0f / total_length; for (float &value : curve_lengths) {