Blender V5.0
blender::bke::Instances Class Reference

#include <BKE_instances.hh>

Public Member Functions

 Instances ()
 Instances (Instances &&other)
 Instances (const Instances &other)
 ~Instances ()
Instancesoperator= (const Instances &other)
Instancesoperator= (Instances &&other)
void resize (int capacity)
int add_reference (const InstanceReference &reference)
int add_new_reference (const InstanceReference &reference)
std::optional< int > find_reference_handle (const InstanceReference &query)
void add_instance (int instance_handle, const float4x4 &transform)
Span< InstanceReferencereferences () const
MutableSpan< InstanceReferencereferences_for_write ()
void remove_unused_references ()
void ensure_geometry_instances ()
GeometrySetgeometry_set_from_reference (int reference_index)
Span< int > reference_handles () const
MutableSpan< int > reference_handles_for_write ()
Span< float4x4transforms () const
MutableSpan< float4x4transforms_for_write ()
int instances_num () const
int references_num () const
void remove (const IndexMask &mask, const AttributeFilter &attribute_filter)
Span< int > unique_ids () const
Span< int > reference_user_counts () const
bke::AttributeAccessor attributes () const
bke::MutableAttributeAccessor attributes_for_write ()
void foreach_referenced_geometry (FunctionRef< void(const GeometrySet &geometry_set)> callback) const
bool owns_direct_data () const
void ensure_owns_direct_data ()
void count_memory (MemoryCounter &memory) const
void tag_reference_handles_changed ()
#InstanceReference Inline Methods
bke::AttributeStorageattribute_storage ()
const bke::AttributeStorageattribute_storage () const

Detailed Description

Definition at line 112 of file BKE_instances.hh.

Constructor & Destructor Documentation

◆ Instances() [1/3]

blender::bke::Instances::Instances ( )
default

◆ Instances() [2/3]

blender::bke::Instances::Instances ( Instances && other)

Definition at line 151 of file instances.cc.

References Instances().

◆ Instances() [3/3]

blender::bke::Instances::Instances ( const Instances & other)

Definition at line 160 of file instances.cc.

References Instances().

◆ ~Instances()

blender::bke::Instances::~Instances ( )
default

References Instances(), mask(), and transform().

Member Function Documentation

◆ add_instance()

◆ add_new_reference()

int blender::bke::Instances::add_new_reference ( const InstanceReference & reference)

◆ add_reference()

◆ attribute_storage() [1/2]

AttributeStorage & blender::bke::Instances::attribute_storage ( )
inline

◆ attribute_storage() [2/2]

const AttributeStorage & blender::bke::Instances::attribute_storage ( ) const
inline

Definition at line 314 of file BKE_instances.hh.

◆ attributes()

◆ attributes_for_write()

◆ count_memory()

void blender::bke::Instances::count_memory ( MemoryCounter & memory) const

Definition at line 423 of file instances.cc.

◆ ensure_geometry_instances()

◆ ensure_owns_direct_data()

void blender::bke::Instances::ensure_owns_direct_data ( )

◆ find_reference_handle()

std::optional< int > blender::bke::Instances::find_reference_handle ( const InstanceReference & query)

Definition at line 250 of file instances.cc.

References i.

Referenced by add_reference().

◆ foreach_referenced_geometry()

◆ geometry_set_from_reference()

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.

◆ instances_num()

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().

◆ operator=() [1/2]

Instances & blender::bke::Instances::operator= ( const Instances & other)

Definition at line 171 of file instances.cc.

References Instances().

◆ operator=() [2/2]

Instances & blender::bke::Instances::operator= ( Instances && other)

Definition at line 181 of file instances.cc.

References Instances().

◆ owns_direct_data()

bool blender::bke::Instances::owns_direct_data ( ) const

Definition at line 403 of file instances.cc.

◆ reference_handles()

◆ reference_handles_for_write()

◆ reference_user_counts()

◆ references()

◆ references_for_write()

◆ references_num()

int blender::bke::Instances::references_num ( ) const

◆ remove()

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().

◆ remove_unused_references()

◆ resize()

◆ tag_reference_handles_changed()

void blender::bke::Instances::tag_reference_handles_changed ( )
inline

◆ transforms()

◆ transforms_for_write()

◆ unique_ids()

Span< int > blender::bke::Instances::unique_ids ( ) const

The documentation for this class was generated from the following files: