|
Blender V5.0
|
#include <BKE_instances.hh>
Definition at line 112 of file BKE_instances.hh.
|
default |
References Instances().
Referenced by Instances(), Instances(), Instances(), operator=(), operator=(), remove(), and ~Instances().
| blender::bke::Instances::Instances | ( | Instances && | other | ) |
Definition at line 151 of file instances.cc.
References Instances().
| blender::bke::Instances::Instances | ( | const Instances & | other | ) |
Definition at line 160 of file instances.cc.
References Instances().
|
default |
References Instances(), mask(), and transform().
| 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 204 of file instances.cc.
References BLI_assert, blender::bke::Instance, 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 269 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 261 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().
|
inline |
Definition at line 309 of file BKE_instances.hh.
Referenced by blender::geometry::debug_randomize_instance_order(), and blender::bke::get_instances_accessor_functions().
|
inline |
Definition at line 314 of file BKE_instances.hh.
| AttributeAccessor blender::bke::Instances::attributes | ( | ) | const |
Definition at line 64 of file instances.cc.
References blender::bke::instance_attribute_accessor_functions().
Referenced by 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(), blender::bke::bake::serialize_geometry_set(), and unique_ids().
| MutableAttributeAccessor blender::bke::Instances::attributes_for_write | ( | ) |
Definition at line 69 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(), blender::geometry::remove_id_attribute_from_instances(), resize(), and blender::geometry::tests::TEST_F().
| void blender::bke::Instances::count_memory | ( | MemoryCounter & | memory | ) | const |
Definition at line 423 of file instances.cc.
| 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 107 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(), blender::geometry::extract_real_geometries_recursive(), and blender::geometry::remove_id_attribute_from_instances().
| void blender::bke::Instances::ensure_owns_direct_data | ( | ) |
Definition at line 413 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 75 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 241 of file instances.cc.
References BLI_assert, and blender::bke::InstanceReference::GeometrySet.
| int blender::bke::Instances::instances_num | ( | ) | const |
Definition at line 393 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::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(), resize(), 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 171 of file instances.cc.
References Instances().
Definition at line 181 of file instances.cc.
References Instances().
| bool blender::bke::Instances::owns_direct_data | ( | ) | const |
Definition at line 403 of file instances.cc.
| Span< int > blender::bke::Instances::reference_handles | ( | ) | const |
Definition at line 215 of file instances.cc.
References blender::bke::get_span_attribute(), and blender::bke::Instance.
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 blender::bke::get_mutable_attribute(), and blender::bke::Instance.
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 275 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::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().
| MutableSpan< InstanceReference > blender::bke::Instances::references_for_write | ( | ) |
Definition at line 280 of file instances.cc.
Referenced by blender::geometry::extract_real_geometries_recursive(), blender::geometry::reinsert_modified_geometry_recursive(), and blender::geometry::remove_id_attribute_from_instances().
| int blender::bke::Instances::references_num | ( | ) | const |
Definition at line 398 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 285 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 311 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 191 of file instances.cc.
References attributes_for_write(), blender::bke::fill_attribute_range_default(), blender::IndexRange::from_begin_end(), blender::bke::Instance, and instances_num().
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 228 of file instances.cc.
References blender::bke::get_span_attribute(), and blender::bke::Instance.
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 235 of file instances.cc.
References blender::bke::get_mutable_attribute(), and blender::bke::Instance.
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().
| Span< int > blender::bke::Instances::unique_ids | ( | ) | const |
Get an id for every instance. These can be used e.g. motion blur. This is based on the "id" attribute but makes sure that the ids are actually unique.
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().