From 6d162d35e2c85ea4fb990f0c459ec36064cf0550 Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Tue, 21 Sep 2021 14:20:54 -0500 Subject: Geometry Nodes: Fill instances separately in the curve fill node With this commit, each referenced instance data will be converted to a geometry instances and processed separately. This should result in a large speedup when the instances component has many insances referring to the same data. This change can act as a blueprint for other nodes that need to implement similar behavior. It adds some helper functions on the instances component to make that easier. Thanks to Erik Abrahamsson for a proof of concept patch. Differential Revision: https://developer.blender.org/D12572 --- source/blender/blenkernel/BKE_geometry_set.hh | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source/blender/blenkernel/BKE_geometry_set.hh') diff --git a/source/blender/blenkernel/BKE_geometry_set.hh b/source/blender/blenkernel/BKE_geometry_set.hh index 98f5de43f84..317d513dae6 100644 --- a/source/blender/blenkernel/BKE_geometry_set.hh +++ b/source/blender/blenkernel/BKE_geometry_set.hh @@ -580,6 +580,9 @@ class InstancesComponent : public GeometryComponent { blender::Span references() const; + void ensure_geometry_instances(); + GeometrySet &geometry_set_from_reference(const int reference_index); + blender::Span instance_reference_handles() const; blender::MutableSpan instance_reference_handles(); blender::MutableSpan instance_transforms(); @@ -588,6 +591,7 @@ class InstancesComponent : public GeometryComponent { blender::Span instance_ids() const; int instances_amount() const; + int references_amount() const; blender::Span almost_unique_ids() const; -- cgit v1.2.3