From 96cc6030375b9173ae6b234a12d3af25bfbc0aa6 Mon Sep 17 00:00:00 2001 From: Jacques Lucke Date: Thu, 14 Jul 2022 11:49:28 +0200 Subject: 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. --- source/blender/geometry/intern/realize_instances.cc | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'source/blender/geometry') 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(); -- cgit v1.2.3