[Bf-blender-cvs] [f2d70c02f88] blender-v2.93-release: Fix (unreported): Geometry nodes instance ids not copied or cleared

Hans Goudey noreply at git.blender.org
Mon Apr 26 04:43:53 CEST 2021


Commit: f2d70c02f88cc00266d330d89ea916e26c0ecf44
Author: Hans Goudey
Date:   Sun Apr 25 21:41:59 2021 -0500
Branches: blender-v2.93-release
https://developer.blender.org/rBf2d70c02f88cc00266d330d89ea916e26c0ecf44

Fix (unreported): Geometry nodes instance ids not copied or cleared

Though to my knowledge we haven't had a report about this yet, this
looks like a clear oversight-- the ids are just more data stored by the
instances component, and should be cleared and copied like other data.

This might have resulted in incorrect random IDs for instances in
renderers in some cases where the component had to be copied.

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

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

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

diff --git a/source/blender/blenkernel/intern/geometry_component_instances.cc b/source/blender/blenkernel/intern/geometry_component_instances.cc
index 11526eda762..feb30e8575a 100644
--- a/source/blender/blenkernel/intern/geometry_component_instances.cc
+++ b/source/blender/blenkernel/intern/geometry_component_instances.cc
@@ -44,6 +44,7 @@ GeometryComponent *InstancesComponent::copy() const
   InstancesComponent *new_component = new InstancesComponent();
   new_component->transforms_ = transforms_;
   new_component->instanced_data_ = instanced_data_;
+  new_component->ids_ = ids_;
   return new_component;
 }
 
@@ -51,6 +52,7 @@ void InstancesComponent::clear()
 {
   instanced_data_.clear();
   transforms_.clear();
+  ids_.clear();
 }
 
 void InstancesComponent::add_instance(Object *object, float4x4 transform, const int id)



More information about the Bf-blender-cvs mailing list