[Bf-blender-cvs] [96cc6030375] master: Geometry Nodes: update curve type counts after realizing instances

Jacques Lucke noreply at git.blender.org
Thu Jul 14 11:49:01 CEST 2022


Commit: 96cc6030375b9173ae6b234a12d3af25bfbc0aa6
Author: Jacques Lucke
Date:   Thu Jul 14 11:49:28 2022 +0200
Branches: master
https://developer.blender.org/rB96cc6030375b9173ae6b234a12d3af25bfbc0aa6

Geometry Nodes: update curve type counts after realizing instances

The type counts have to be updated eagerly. This was missing from
the realize-instances code before, leading to bugs further down
the line.

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

M	source/blender/geometry/intern/realize_instances.cc

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

diff --git a/source/blender/geometry/intern/realize_instances.cc b/source/blender/geometry/intern/realize_instances.cc
index 25bf00c5783..66b856ee0c4 100644
--- a/source/blender/geometry/intern/realize_instances.cc
+++ b/source/blender/geometry/intern/realize_instances.cc
@@ -1295,6 +1295,15 @@ static void execute_realize_curve_tasks(const RealizeInstancesOptions &options,
     }
   });
 
+  /* Type counts have to be updated eagerly. */
+  dst_curves.runtime->type_counts.fill(0);
+  for (const RealizeCurveTask &task : tasks) {
+    for (const int i : IndexRange(CURVE_TYPES_NUM)) {
+      dst_curves.runtime->type_counts[i] +=
+          task.curve_info->curves->geometry.runtime->type_counts[i];
+    }
+  }
+
   /* Tag modified attributes. */
   for (GSpanAttributeWriter &dst_attribute : dst_attribute_writers) {
     dst_attribute.finish();



More information about the Bf-blender-cvs mailing list