[Bf-blender-cvs] [d1c080b737a] temp-pbvh-split: Fix: Spline parameter node broken for Catmull Rom curves

Hans Goudey noreply at git.blender.org
Fri Jun 3 01:16:30 CEST 2022


Commit: d1c080b737a0f43e4319f24e19567f7d0f6fb198
Author: Hans Goudey
Date:   Wed May 11 11:33:47 2022 +0200
Branches: temp-pbvh-split
https://developer.blender.org/rBd1c080b737a0f43e4319f24e19567f7d0f6fb198

Fix: Spline parameter node broken for Catmull Rom curves

Subtracting one from the evaluated index could make the index -1.
That was only necessary for Bezier curves due to the specifics of
the "bezier_evaluated_offsets".

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

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 a548becf24e..ae36248b573 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
@@ -75,7 +75,7 @@ static Array<float> curve_length_point_domain(const bke::CurvesGeometry &curves)
         case CURVE_TYPE_CATMULL_ROM: {
           const int resolution = resolutions[i_curve];
           for (const int i : IndexRange(points.size()).drop_back(1)) {
-            lengths[i + 1] = evaluated_lengths[resolution * i - 1];
+            lengths[i + 1] = evaluated_lengths[resolution * i];
           }
           break;
         }



More information about the Bf-blender-cvs mailing list