diff options
author | Jacques Lucke <jacques@blender.org> | 2021-02-12 19:50:44 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2021-02-12 19:50:44 +0300 |
commit | ff3df2ea568f6f55cdee74ce6ed5586c15af2062 (patch) | |
tree | 476c43d3a869097b30e1581a10538de763574efd /source/blender/blenkernel/BKE_geometry_set.hh | |
parent | c04bcc87fe720102b70ef4366bcc74bdf9f07131 (diff) | |
parent | 98db4cc6391df8c8b21516bbdbc0af8f493a15b3 (diff) |
Merge branch 'blender-v2.92-release'
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; |