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.
This commit is contained in:
Hans Goudey 2021-04-25 21:41:59 -05:00
parent db3b610040
commit f2d70c02f8
1 changed files with 2 additions and 0 deletions

View File

@ -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)