|
Blender V4.5
|
#include <BKE_instances.hh>
Definition at line 113 of file BKE_instances.hh.
| blender::bke::Instances::Instances | ( | ) |
Definition at line 148 of file instances.cc.
References CustomData_reset().
Referenced by Instances(), Instances(), operator=(), operator=(), and remove().
| blender::bke::Instances::Instances | ( | Instances && | other | ) |
Definition at line 153 of file instances.cc.
References CustomData_reset(), and Instances().
| blender::bke::Instances::Instances | ( | const Instances & | other | ) |
Definition at line 163 of file instances.cc.
References CD_MASK_ALL, CustomData_init_from(), and Instances().
| blender::bke::Instances::~Instances | ( | ) |
Definition at line 172 of file instances.cc.
References CustomData_free().
| void blender::bke::Instances::add_instance | ( | int | instance_handle, |
| const float4x4 & | transform ) |
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 203 of file instances.cc.
References BLI_assert, CustomData_realloc(), MutableSpan< T >::last(), reference_handles_for_write(), tag_reference_handles_changed(), transform(), and transforms_for_write().
Referenced by BPy_GeometrySet_static_from_evaluated_object(), blender::bke::convert_collection_to_instances(), blender::nodes::node_geo_curve_to_mesh_cc::grease_pencil_to_mesh(), blender::nodes::node_geo_curve_to_points_cc::layer_pointclouds_to_instances(), blender::nodes::node_geo_grease_pencil_to_curves_cc::node_geo_exec(), blender::nodes::node_geo_import_obj::node_geo_exec(), blender::nodes::node_geo_instance_on_points_cc::node_geo_exec(), and blender::geometry::tests::TEST_F().
| int blender::bke::Instances::add_new_reference | ( | const InstanceReference & | reference | ) |
Same as above, but does not deduplicate with existing references.
Definition at line 279 of file instances.cc.
References tag_reference_handles_changed().
Referenced by add_reference(), BPy_GeometrySet_static_from_evaluated_object(), blender::ed::curves::join_objects_exec(), blender::ed::pointcloud::join_objects_exec(), and object_duplilist_legacy_instances().
| 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 271 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(), blender::bke::convert_collection_to_instances(), blender::geometry::copy_and_reorder_instaces(), blender::nodes::node_geo_string_to_curves_cc::create_curve_instances(), blender::nodes::node_geo_curve_to_mesh_cc::grease_pencil_to_mesh(), blender::nodes::node_geo_curve_to_points_cc::layer_pointclouds_to_instances(), blender::nodes::node_geo_grease_pencil_to_curves_cc::node_geo_exec(), blender::nodes::node_geo_import_obj::node_geo_exec(), blender::nodes::node_geo_instance_on_points_cc::node_geo_exec(), blender::nodes::node_geo_split_to_instances_cc::node_geo_exec(), and blender::geometry::tests::TEST_F().
| Span< int > blender::bke::Instances::almost_unique_ids | ( | ) | const |
Get an id for every instance. These can be used e.g. motion blur.
Definition at line 505 of file instances.cc.
References blender::Array< T, InlineBufferCapacity, Allocator >::as_mutable_span(), attributes(), Span< T >::data(), blender::array_utils::fill_index_range(), blender::bke::generate_unique_instance_ids(), blender::Span< T >::is_empty(), blender::bke::AttributeAccessor::lookup(), and blender::Array< T, InlineBufferCapacity, Allocator >::reinitialize().
Referenced by make_duplis_geometry_set_impl().
| AttributeAccessor blender::bke::Instances::attributes | ( | ) | const |
Definition at line 63 of file instances.cc.
References blender::bke::instance_attribute_accessor_functions().
Referenced by almost_unique_ids(), BPy_GeometrySet_get_instances_pointcloud(), blender::nodes::node_geo_instances_to_points_cc::convert_instances_to_points(), blender::geometry::copy_and_reorder_instaces(), blender::nodes::node_geo_curves_to_grease_pencil_cc::curve_instances_to_grease_pencil_layers(), blender::nodes::node_geo_duplicate_elements_cc::duplicate_instances(), blender::geometry::extract_instances(), blender::geometry::gather_realize_tasks_for_instances(), blender::draw::overlay::AttributeTexts::object_sync(), blender::geometry::prepare_attribute_fallbacks(), remove(), and blender::bke::bake::serialize_geometry_set().
| MutableAttributeAccessor blender::bke::Instances::attributes_for_write | ( | ) |
Definition at line 68 of file instances.cc.
References blender::bke::instance_attribute_accessor_functions().
Referenced by blender::nodes::node_geo_instance_on_points_cc::add_instances_from_component(), blender::geometry::copy_and_reorder_instaces(), blender::nodes::node_geo_string_to_curves_cc::create_attributes(), blender::nodes::node_geo_curve_to_mesh_cc::grease_pencil_to_mesh(), blender::nodes::node_geo_curve_to_points_cc::layer_pointclouds_to_instances(), blender::nodes::node_geo_grease_pencil_to_curves_cc::node_geo_exec(), blender::nodes::node_geo_instance_on_points_cc::node_geo_exec(), blender::nodes::node_geo_split_to_instances_cc::node_geo_exec(), object_duplilist_legacy_instances(), remove(), and blender::geometry::tests::TEST_F().
| void blender::bke::Instances::count_memory | ( | MemoryCounter & | memory | ) | const |
Definition at line 428 of file instances.cc.
References CustomData_count_memory().
|
inline |
Definition at line 309 of file BKE_instances.hh.
Referenced by blender::bke::create_attribute_providers_for_instances(), and blender::geometry::debug_randomize_instance_order().
|
inline |
Definition at line 314 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 115 of file geometry_set_instances.cc.
References blender::Vector< T, InlineBufferCapacity, Allocator >::append(), BKE_id_name(), 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(), handles, blender::bke::GeometrySet::has_instances(), i, Collection::id, blender::Vector< T, InlineBufferCapacity, Allocator >::index_range(), Collection::instance_offset, blender::bke::GeometrySet::name, blender::bke::InstanceReference::None, OB_ARMATURE, OB_CAMERA, OB_LAMP, OB_SPEAKER, blender::bke::InstanceReference::Object, blender::bke::object_get_evaluated_geometry_set(), blender::Vector< T, InlineBufferCapacity, Allocator >::reserve(), blender::Vector< T, InlineBufferCapacity, Allocator >::size(), 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 418 of file instances.cc.
References blender::bke::InstanceReference::ensure_owns_direct_data().
| std::optional< int > blender::bke::Instances::find_reference_handle | ( | const InstanceReference & | query | ) |
| void blender::bke::Instances::foreach_referenced_geometry | ( | FunctionRef< void(const GeometrySet &geometry_set)> | callback | ) | const |
Definition at line 83 of file geometry_set_instances.cc.
References 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 251 of file instances.cc.
References BLI_assert, and blender::bke::InstanceReference::GeometrySet.
Referenced by blender::bke::gather_mutable_geometry_sets().
| int blender::bke::Instances::instances_num | ( | ) | const |
Definition at line 398 of file instances.cc.
Referenced by blender::nodes::node_geo_instance_on_points_cc::add_instances_from_component(), BPy_GeometrySet_get_instances_pointcloud(), BPy_GeometrySet_static_from_evaluated_object(), blender::nodes::node_geo_instances_to_points_cc::convert_instances_to_points(), blender::geometry::copy_and_reorder_instaces(), blender::bke::create_attribute_providers_for_instances(), blender::nodes::node_geo_curves_to_grease_pencil_cc::curve_instances_to_grease_pencil_layers(), blender::geometry::debug_randomize_instance_order(), blender::geometry::delete_selected_instances(), blender::io::usd::USDPointInstancerWriter::do_write(), blender::nodes::node_geo_duplicate_elements_cc::duplicate_instances(), blender::geometry::execute_instances_tasks(), blender::geometry::extract_instances(), blender::geometry::gather_realize_tasks_for_instances(), blender::geometry::gather_realize_tasks_recursive(), blender::bke::get_instances_accessor_functions(), blender::bke::GeometrySet::has_instances(), blender::nodes::node_geo_store_named_attribute_cc::node_geo_exec(), blender::bke::GeometrySet::operator<<, blender::geometry::prepare_attribute_fallbacks(), blender::geometry::propagate_instances_to_keep(), blender::geometry::realize_instances(), blender::nodes::node_geo_rotate_instances_cc::rotate_instances(), blender::nodes::node_geo_scale_instances_cc::scale_instances(), blender::geometry::seed_from_instances(), blender::bke::bake::serialize_geometry_set(), blender::nodes::node_geo_set_position_cc::set_instances_position(), and blender::nodes::node_geo_translate_instances_cc::translate_instances().
Definition at line 177 of file instances.cc.
References Instances().
Definition at line 187 of file instances.cc.
References Instances().
| bool blender::bke::Instances::owns_direct_data | ( | ) | const |
Definition at line 408 of file instances.cc.
| Span< int > blender::bke::Instances::reference_handles | ( | ) | const |
Definition at line 215 of file instances.cc.
References CD_PROP_INT32, and CustomData_get_layer_named().
Referenced by blender::nodes::node_geo_curves_to_grease_pencil_cc::curve_instances_to_grease_pencil_layers(), blender::io::usd::USDPointInstancerWriter::do_write(), blender::nodes::node_geo_duplicate_elements_cc::duplicate_instances(), blender::geometry::execute_instances_tasks(), blender::geometry::extract_instances(), blender::ed::view3d::geometry_nodes_gizmos::find_gizmo_geometry_transform_recursive(), blender::geometry::gather_attribute_propagation_components_with_custom_depths(), blender::geometry::gather_realize_tasks_for_instances(), blender::geometry::join_instances(), make_duplis_geometry_set_impl(), reference_user_counts(), and remove_unused_references().
| MutableSpan< int > blender::bke::Instances::reference_handles_for_write | ( | ) |
Definition at line 222 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_string_to_curves_cc::add_instances_from_handles(), blender::ed::curves::join_objects_exec(), blender::ed::pointcloud::join_objects_exec(), blender::nodes::node_geo_split_to_instances_cc::node_geo_exec(), object_duplilist_legacy_instances(), and remove_unused_references().
| Span< int > blender::bke::Instances::reference_user_counts | ( | ) | const |
Get cached user counts for every reference.
Definition at line 488 of file instances.cc.
References Span< T >::data(), blender::Array< T, InlineBufferCapacity, Allocator >::fill(), handles, reference_handles(), references_num(), and blender::Array< T, InlineBufferCapacity, Allocator >::reinitialize().
Referenced by blender::ed::spreadsheet::InstanceReferenceViewItem::InstanceReferenceViewItem().
| Span< InstanceReference > blender::bke::Instances::references | ( | ) | const |
Definition at line 285 of file instances.cc.
Referenced by BPy_GeometrySet_get_instance_references(), blender::ed::spreadsheet::GeometryInstancesTreeView::build_tree_for_instances(), blender::geometry::copy_and_reorder_instaces(), blender::nodes::node_geo_curves_to_grease_pencil_cc::curve_instances_to_grease_pencil_layers(), blender::io::usd::USDPointInstancerWriter::do_write(), blender::nodes::node_geo_duplicate_elements_cc::duplicate_instances(), blender::geometry::execute_instances_tasks(), blender::geometry::extract_instances(), blender::ed::view3d::geometry_nodes_gizmos::find_gizmo_geometry_transform_recursive(), blender::geometry::gather_attribute_propagation_components(), blender::geometry::gather_attribute_propagation_components_with_custom_depths(), blender::bke::gather_mutable_geometry_sets(), blender::geometry::gather_realize_tasks_for_instances(), blender::ed::spreadsheet::get_geometry_set_for_instance_ids(), blender::ed::view3d::geometry_nodes_gizmos::has_nested_gizmo_transform(), blender::geometry::join_instances(), make_duplis_geometry_set_impl(), and blender::bke::bake::serialize_geometry_set().
| int blender::bke::Instances::references_num | ( | ) | const |
Definition at line 403 of file instances.cc.
References blender::Vector< T, InlineBufferCapacity, Allocator >::size().
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 290 of file instances.cc.
References attributes(), attributes_for_write(), blender::bke::gather_attributes(), blender::bke::Instance, Instances(), mask(), remove_unused_references(), resize(), and blender::index_mask::IndexMask::size().
Referenced by blender::geometry::delete_selected_instances().
| void blender::bke::Instances::remove_unused_references | ( | ) |
Definition at line 316 of file instances.cc.
References blender::Vector< T, InlineBufferCapacity, Allocator >::append(), blender::Array< T, InlineBufferCapacity, Allocator >::as_span(), BLI_assert, i, lock, mutex, blender::threading::parallel_for(), 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 197 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_string_to_curves_cc::add_instances_from_handles(), blender::geometry::copy_and_reorder_instaces(), blender::ed::curves::join_objects_exec(), blender::ed::pointcloud::join_objects_exec(), blender::nodes::node_geo_split_to_instances_cc::node_geo_exec(), object_duplilist_legacy_instances(), and remove().
|
inline |
Definition at line 224 of file BKE_instances.hh.
Referenced by add_instance(), add_new_reference(), and blender::bke::tag_component_reference_index_changed().
Definition at line 233 of file instances.cc.
References CD_PROP_FLOAT4X4, and CustomData_get_layer_named().
Referenced by blender::geometry::copy_and_reorder_instaces(), blender::nodes::node_geo_curves_to_grease_pencil_cc::curve_instances_to_grease_pencil_layers(), blender::io::usd::USDPointInstancerWriter::do_write(), ensure_geometry_instances(), blender::geometry::execute_instances_tasks(), blender::geometry::extract_instances(), blender::ed::view3d::geometry_nodes_gizmos::find_gizmo_geometry_transform_recursive(), blender::geometry::gather_realize_tasks_for_instances(), blender::bke::instance_position_varray(), and make_duplis_geometry_set_impl().
| MutableSpan< float4x4 > blender::bke::Instances::transforms_for_write | ( | ) |
Definition at line 240 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(), blender::nodes::node_geo_string_to_curves_cc::add_instances_from_handles(), blender::geometry::copy_and_reorder_instaces(), blender::bke::instance_position_varray_for_write(), blender::ed::curves::join_objects_exec(), blender::ed::pointcloud::join_objects_exec(), blender::nodes::node_geo_split_to_instances_cc::node_geo_exec(), object_duplilist_legacy_instances(), blender::nodes::node_geo_rotate_instances_cc::rotate_instances(), blender::nodes::node_geo_scale_instances_cc::scale_instances(), blender::nodes::node_geo_set_position_cc::set_instances_position(), blender::geometry::transform_instances(), blender::geometry::translate_instances(), and blender::nodes::node_geo_translate_instances_cc::translate_instances().