|
Blender V4.3
|
#include <BKE_instances.hh>
Definition at line 112 of file BKE_instances.hh.
| blender::bke::Instances::Instances | ( | ) |
Definition at line 140 of file instances.cc.
References CustomData_reset().
Referenced by operator=(), and operator=().
| blender::bke::Instances::Instances | ( | Instances && | other | ) |
Definition at line 145 of file instances.cc.
References CustomData_reset().
| blender::bke::Instances::Instances | ( | const Instances & | other | ) |
Definition at line 155 of file instances.cc.
References CD_MASK_ALL, and CustomData_init_from().
| blender::bke::Instances::~Instances | ( | ) |
Definition at line 164 of file instances.cc.
References CustomData_free().
Add a reference to the instance reference with an index specified by the #instance_handle argument. For adding many instances, using resize and accessing the transform array directly is preferred.
Definition at line 195 of file instances.cc.
References BLI_assert, CustomData_realloc(), blender::MutableSpan< T >::last(), reference_handles_for_write(), tag_reference_handles_changed(), transform(), and transforms_for_write().
| int blender::bke::Instances::add_new_reference | ( | const InstanceReference & | reference | ) |
Same as above, but does not deduplicate with existing references.
Definition at line 271 of file instances.cc.
References tag_reference_handles_changed().
Referenced by add_reference().
| int blender::bke::Instances::add_reference | ( | const InstanceReference & | reference | ) |
Returns a handle for the given reference. If the reference exists already, the handle of the existing reference is returned. Otherwise a new handle is added.
Definition at line 263 of file instances.cc.
References add_new_reference(), and find_reference_handle().
Referenced by blender::nodes::node_geo_instance_on_points_cc::add_instances_from_component(), and blender::nodes::node_geo_split_to_instances_cc::node_geo_exec().
Get an id for every instance. These can be used for e.g. motion blur.
Definition at line 497 of file instances.cc.
References blender::Array< T, InlineBufferCapacity, Allocator >::as_mutable_span(), attributes(), blender::array_utils::fill_index_range(), blender::bke::generate_unique_instance_ids(), blender::bke::AttributeAccessor::lookup(), blender::Array< T, InlineBufferCapacity, Allocator >::reinitialize(), blender::Array< T, InlineBufferCapacity, Allocator >::size(), blender::Span< T >::size(), and blender::bke::AttributeReader< T >::varray.
| AttributeAccessor blender::bke::Instances::attributes | ( | ) | const |
Definition at line 215 of file geometry_component_instances.cc.
References blender::bke::get_instances_accessor_functions_ref().
Referenced by almost_unique_ids(), blender::nodes::node_geo_duplicate_elements_cc::duplicate_instances(), remove(), and blender::geometry::reorder_instaces_exec().
| MutableAttributeAccessor blender::bke::Instances::attributes_for_write | ( | ) |
Definition at line 220 of file geometry_component_instances.cc.
References blender::bke::get_instances_accessor_functions_ref().
Referenced by blender::nodes::node_geo_instance_on_points_cc::add_instances_from_component(), blender::nodes::node_geo_split_to_instances_cc::node_geo_exec(), remove(), blender::geometry::reorder_instaces(), and blender::geometry::reorder_instaces_exec().
| void blender::bke::Instances::count_memory | ( | MemoryCounter & | memory | ) | const |
Definition at line 420 of file instances.cc.
References CustomData_count_memory().
Referenced by blender::bke::InstancesComponent::count_memory().
|
inline |
Definition at line 307 of file BKE_instances.hh.
Referenced by blender::bke::create_attribute_providers_for_instances().
|
inline |
Definition at line 312 of file BKE_instances.hh.
| void blender::bke::Instances::ensure_geometry_instances | ( | ) |
If references have a collection or object type, convert them into geometry instances recursively. After that, the geometry sets can be edited. There may still be instances of other types of they can't be converted to geometry sets.
Definition at line 104 of file geometry_set_instances.cc.
References blender::Vector< T, InlineBufferCapacity, Allocator >::append(), blender::bke::InstanceReference::Collection, ELEM, ensure_geometry_instances(), FOREACH_COLLECTION_OBJECT_RECURSIVE_BEGIN, FOREACH_COLLECTION_OBJECT_RECURSIVE_END, blender::bke::GeometrySet::from_instances(), blender::bke::InstanceReference::GeometrySet, blender::bke::GeometrySet::get_instances_for_write(), blender::bke::GeometrySet::has_instances(), blender::bke::InstanceReference::None, OB_ARMATURE, OB_CAMERA, OB_GPENCIL_LEGACY, OB_LAMP, OB_SPEAKER, blender::bke::InstanceReference::Object, blender::bke::object_get_evaluated_geometry_set(), blender::Vector< T, InlineBufferCapacity, Allocator >::reserve(), and transforms().
Referenced by ensure_geometry_instances(), and blender::bke::gather_mutable_geometry_sets().
| void blender::bke::Instances::ensure_owns_direct_data | ( | ) |
Definition at line 410 of file instances.cc.
References blender::bke::InstanceReference::ensure_owns_direct_data().
Referenced by blender::bke::InstancesComponent::ensure_owns_direct_data().
| std::optional< int > blender::bke::Instances::find_reference_handle | ( | const InstanceReference & | query | ) |
Definition at line 252 of file instances.cc.
Referenced by add_reference().
| void blender::bke::Instances::foreach_referenced_geometry | ( | FunctionRef< void(const GeometrySet &geometry_set)> | callback | ) | const |
Definition at line 72 of file geometry_set_instances.cc.
References callback, blender::bke::InstanceReference::Collection, FOREACH_COLLECTION_OBJECT_RECURSIVE_BEGIN, FOREACH_COLLECTION_OBJECT_RECURSIVE_END, blender::bke::InstanceReference::GeometrySet, blender::bke::InstanceReference::None, blender::bke::InstanceReference::Object, and blender::bke::object_get_evaluated_geometry_set().
Referenced by blender::bke::GeometrySet::attribute_foreach(), and blender::bke::gather_component_types_recursive().
| GeometrySet & blender::bke::Instances::geometry_set_from_reference | ( | int | reference_index | ) |
With write access to the instances component, the data in the instanced geometry sets can be changed. This is a function on the component rather than each reference to ensure const correctness for that reason.
Definition at line 243 of file instances.cc.
References BLI_assert, and blender::bke::InstanceReference::GeometrySet.
| int blender::bke::Instances::instances_num | ( | ) | const |
Definition at line 390 of file instances.cc.
Referenced by blender::nodes::node_geo_instance_on_points_cc::add_instances_from_component(), blender::ed::spreadsheet::InstancesViewItem::build_row(), blender::bke::create_attribute_providers_for_instances(), blender::nodes::node_geo_duplicate_elements_cc::duplicate_instances(), blender::geometry::execute_instances_tasks(), blender::bke::get_instances_accessor_functions(), blender::bke::GeometrySet::has_instances(), blender::bke::InstancesComponent::is_empty(), and blender::geometry::realize_instances().
Definition at line 169 of file instances.cc.
References Instances().
Definition at line 179 of file instances.cc.
References Instances().
| bool blender::bke::Instances::owns_direct_data | ( | ) | const |
Definition at line 400 of file instances.cc.
Referenced by blender::bke::InstancesComponent::owns_direct_data().
Definition at line 207 of file instances.cc.
References CD_PROP_INT32, and CustomData_get_layer_named().
Referenced by blender::nodes::node_geo_duplicate_elements_cc::duplicate_instances(), blender::geometry::execute_instances_tasks(), blender::geometry::join_instances(), reference_user_counts(), and remove_unused_references().
| MutableSpan< int > blender::bke::Instances::reference_handles_for_write | ( | ) |
Definition at line 214 of file instances.cc.
References CD_PROP_INT32, CD_SET_DEFAULT, CustomData_add_layer_named(), CustomData_get_layer_named_for_write(), and data.
Referenced by add_instance(), blender::nodes::node_geo_instance_on_points_cc::add_instances_from_component(), blender::nodes::node_geo_split_to_instances_cc::node_geo_exec(), and remove_unused_references().
Get cached user counts for every reference.
Definition at line 480 of file instances.cc.
References blender::Array< T, InlineBufferCapacity, Allocator >::fill(), handles, reference_handles(), references_num(), and blender::Array< T, InlineBufferCapacity, Allocator >::reinitialize().
| Span< InstanceReference > blender::bke::Instances::references | ( | ) | const |
Definition at line 277 of file instances.cc.
Referenced by blender::nodes::node_geo_duplicate_elements_cc::duplicate_instances(), blender::geometry::execute_instances_tasks(), and blender::geometry::join_instances().
| int blender::bke::Instances::references_num | ( | ) | const |
Definition at line 395 of file instances.cc.
Referenced by reference_user_counts().
| void blender::bke::Instances::remove | ( | const IndexMask & | mask, |
| const AttributeFilter & | attribute_filter ) |
Remove the indices that are not contained in the mask input, and remove unused instance references afterwards.
Definition at line 282 of file instances.cc.
References attributes(), attributes_for_write(), blender::bke::gather_attributes(), blender::bke::Instance, remove_unused_references(), resize(), and blender::index_mask::IndexMask::size().
| void blender::bke::Instances::remove_unused_references | ( | ) |
Definition at line 308 of file instances.cc.
References blender::Vector< T, InlineBufferCapacity, Allocator >::append(), blender::Array< T, InlineBufferCapacity, Allocator >::as_span(), BLI_assert, lock, mutex, blender::threading::parallel_for(), range, reference_handles(), and reference_handles_for_write().
Referenced by remove().
| void blender::bke::Instances::resize | ( | int | capacity | ) |
Resize the transform, handles, and attributes to the specified capacity.
Definition at line 189 of file instances.cc.
References CD_SET_DEFAULT, and CustomData_realloc().
Referenced by blender::nodes::node_geo_instance_on_points_cc::add_instances_from_component(), blender::nodes::node_geo_split_to_instances_cc::node_geo_exec(), and remove().
|
inline |
Definition at line 223 of file BKE_instances.hh.
References blender::SharedCache< T >::tag_dirty().
Referenced by add_instance(), add_new_reference(), and blender::bke::tag_component_reference_index_changed().
Definition at line 225 of file instances.cc.
References CD_PROP_FLOAT4X4, and CustomData_get_layer_named().
Referenced by ensure_geometry_instances(), and blender::geometry::execute_instances_tasks().
| MutableSpan< float4x4 > blender::bke::Instances::transforms_for_write | ( | ) |
Definition at line 232 of file instances.cc.
References CD_PROP_FLOAT4X4, CD_SET_DEFAULT, CustomData_add_layer_named(), CustomData_get_layer_named_for_write(), and data.
Referenced by add_instance(), blender::nodes::node_geo_instance_on_points_cc::add_instances_from_component(), and blender::nodes::node_geo_split_to_instances_cc::node_geo_exec().