[Bf-blender-cvs] [b926f54f3c0] blender-v3.0-release: Fix: error when materializing curve point attribute

Jacques Lucke noreply at git.blender.org
Thu Nov 18 15:29:57 CET 2021


Commit: b926f54f3c0888ee591516f586a4dec5156fb82a
Author: Jacques Lucke
Date:   Thu Nov 18 15:28:04 2021 +0100
Branches: blender-v3.0-release
https://developer.blender.org/rBb926f54f3c0888ee591516f586a4dec5156fb82a

Fix: error when materializing curve point attribute

Differential Revision: https://developer.blender.org/D13271

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

M	source/blender/blenkernel/intern/geometry_component_curve.cc

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

diff --git a/source/blender/blenkernel/intern/geometry_component_curve.cc b/source/blender/blenkernel/intern/geometry_component_curve.cc
index d3c3fcc1e67..961265f3a16 100644
--- a/source/blender/blenkernel/intern/geometry_component_curve.cc
+++ b/source/blender/blenkernel/intern/geometry_component_curve.cc
@@ -563,7 +563,8 @@ static void point_attribute_materialize(Span<Span<T>> data,
   else {
     int spline_index = 0;
     for (const int dst_index : mask) {
-      while (offsets[spline_index] < dst_index) {
+      /* Skip splines that don't have any control points in the mask. */
+      while (dst_index >= offsets[spline_index + 1]) {
         spline_index++;
       }
 
@@ -607,7 +608,8 @@ static void point_attribute_materialize_to_uninitialized(Span<Span<T>> data,
   else {
     int spline_index = 0;
     for (const int dst_index : mask) {
-      while (offsets[spline_index] < dst_index) {
+      /* Skip splines that don't have any control points in the mask. */
+      while (dst_index >= offsets[spline_index + 1]) {
         spline_index++;
       }



More information about the Bf-blender-cvs mailing list