Commit: 74a5fb734ab5ddfa1c4dfbc50e5daf2190ad40a1
Author: Hans Goudey
Date:   Wed May 11 11:33:47 2022 +0200
Branches: master
https://developer.blender.org/rB74a5fb734ab5ddfa1c4dfbc50e5daf2190ad40a1

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;
         }

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to