Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/geometry_component_instances.cc
| Show First 20 Lines • Show All 102 Lines • ▼ Show 20 Lines | int InstancesComponent::instances_amount() const | ||||
| return size; | return size; | ||||
| } | } | ||||
| bool InstancesComponent::is_empty() const | bool InstancesComponent::is_empty() const | ||||
| { | { | ||||
| return transforms_.size() == 0; | return transforms_.size() == 0; | ||||
| } | } | ||||
| bool InstancesComponent::owns_direct_data() const | |||||
| { | |||||
| /* The object and collection instances are not direct data. Instance transforms are direct data | |||||
| * and are always owned. Therefore, instance components always own all their direct data. */ | |||||
| return true; | |||||
| } | |||||
| void InstancesComponent::ensure_owns_direct_data() | |||||
| { | |||||
| BLI_assert(this->is_mutable()); | |||||
| } | |||||
| static blender::Array<int> generate_unique_instance_ids(Span<int> original_ids) | static blender::Array<int> generate_unique_instance_ids(Span<int> original_ids) | ||||
| { | { | ||||
| using namespace blender; | using namespace blender; | ||||
| Array<int> unique_ids(original_ids.size()); | Array<int> unique_ids(original_ids.size()); | ||||
| Set<int> used_unique_ids; | Set<int> used_unique_ids; | ||||
| used_unique_ids.reserve(original_ids.size()); | used_unique_ids.reserve(original_ids.size()); | ||||
| Vector<int> instances_with_id_collision; | Vector<int> instances_with_id_collision; | ||||
| ▲ Show 20 Lines • Show All 55 Lines • Show Last 20 Lines | |||||