diff options
author | Hans Goudey <h.goudey@me.com> | 2021-11-30 18:59:11 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2021-11-30 18:59:11 +0300 |
commit | c822e03e2a58e23d9ef82b30b012f59ae7d1c425 (patch) | |
tree | 9799fccf0a2a46c55477f91ac692e985be0c85d4 /source/blender/blenkernel/intern/geometry_component_instances.cc | |
parent | 2fbb52dd86b3a346945babda9b3f1b5f2ceafa38 (diff) |
Fix: Missing handling of dynamic instance attribute size
The attributes need to be reallocated when the size changes.
Differential Revision: https://developer.blender.org/D13390
Diffstat (limited to 'source/blender/blenkernel/intern/geometry_component_instances.cc')
-rw-r--r-- | source/blender/blenkernel/intern/geometry_component_instances.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/geometry_component_instances.cc b/source/blender/blenkernel/intern/geometry_component_instances.cc index 9a30c86c1e5..29c28a875c1 100644 --- a/source/blender/blenkernel/intern/geometry_component_instances.cc +++ b/source/blender/blenkernel/intern/geometry_component_instances.cc @@ -63,6 +63,7 @@ void InstancesComponent::reserve(int min_capacity) if (!instance_ids_.is_empty()) { this->instance_ids_ensure(); } + attributes_.reallocate(min_capacity); } /** @@ -78,6 +79,7 @@ void InstancesComponent::resize(int capacity) if (!instance_ids_.is_empty()) { this->instance_ids_ensure(); } + attributes_.reallocate(capacity); } void InstancesComponent::clear() @@ -85,6 +87,7 @@ void InstancesComponent::clear() instance_reference_handles_.clear(); instance_transforms_.clear(); instance_ids_.clear(); + attributes_.clear(); references_.clear(); } @@ -98,6 +101,7 @@ void InstancesComponent::add_instance(const int instance_handle, const float4x4 if (!instance_ids_.is_empty()) { this->instance_ids_ensure(); } + attributes_.reallocate(this->instances_amount()); } blender::Span<int> InstancesComponent::instance_reference_handles() const |