diff options
Diffstat (limited to 'source/blender/blenkernel/BKE_geometry_set.hh')
-rw-r--r-- | source/blender/blenkernel/BKE_geometry_set.hh | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_geometry_set.hh b/source/blender/blenkernel/BKE_geometry_set.hh index 5f1ddea0f13..02b3c88183a 100644 --- a/source/blender/blenkernel/BKE_geometry_set.hh +++ b/source/blender/blenkernel/BKE_geometry_set.hh @@ -416,6 +416,13 @@ class InstancesComponent : public GeometryComponent { blender::Vector<int> ids_; blender::Vector<InstancedData> instanced_data_; + /* These almost unique ids are generated based on `ids_`, which might not contain unique ids at + * all. They are *almost* unique, because under certain very unlikely circumstances, they are not + * unique. Code using these ids should not crash when they are not unique but can generally + * expect them to be unique. */ + mutable std::mutex almost_unique_ids_mutex_; + mutable blender::Array<int> almost_unique_ids_; + public: InstancesComponent(); ~InstancesComponent() = default; @@ -432,6 +439,8 @@ class InstancesComponent : public GeometryComponent { blender::MutableSpan<blender::float4x4> transforms(); int instances_amount() const; + blender::Span<int> almost_unique_ids() const; + bool is_empty() const final; static constexpr inline GeometryComponentType static_type = GeometryComponentType::Instances; |