Blender V5.3
blender::Instances Class Reference

#include <BKE_instances.hh>

Public Member Functions

 Instances ()
 Instances (int size)
 Instances (Instances &&other)
 Instances (const Instances &other)
 ~Instances ()
Instances & operator= (const Instances &other)
Instances & operator= (Instances &&other)
void resize (int size)
int add_reference (const InstanceReference &reference)
int add_reference (InstanceReference &&reference)
int add_new_reference (InstanceReference reference)
std::optional< int > find_reference_handle (const InstanceReference &query)
Span< InstanceReference > references () const
MutableSpan< InstanceReference > references_for_write ()
void remove_unused_references ()
void ensure_geometry_instances ()
GeometrySet & geometry_set_from_reference (int reference_index)
Span< int > reference_handles () const
MutableSpan< int > reference_handles_for_write ()
Span< float4x4 > transforms () const
MutableSpan< float4x4 > transforms_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::AttributeStorage & attribute_storage ()
const bke::AttributeStorage & attribute_storage () const

Detailed Description

Definition at line 115 of file BKE_instances.hh.

Constructor & Destructor Documentation

◆ Instances() [1/4]

◆ Instances() [2/4]

Definition at line 171 of file instances.cc.

◆ Instances() [3/4]

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

Definition at line 176 of file instances.cc.

◆ Instances() [4/4]

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

Definition at line 185 of file instances.cc.

◆ ~Instances()

Member Function Documentation

◆ add_new_reference()

Same as above, but does not deduplicate with existing references.

Definition at line 284 of file instances.cc.

◆ add_reference() [1/2]

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 268 of file instances.cc.

◆ add_reference() [2/2]

Definition at line 276 of file instances.cc.

◆ attribute_storage() [1/2]

◆ attribute_storage() [2/2]

Definition at line 312 of file BKE_instances.hh.

◆ attributes()

◆ attributes_for_write()

◆ count_memory()

Definition at line 438 of file instances.cc.

◆ 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 111 of file geometry_set_instances.cc.

◆ ensure_owns_direct_data()

◆ find_reference_handle()

Definition at line 257 of file instances.cc.

◆ foreach_referenced_geometry()

void blender::bke::Instances::foreach_referenced_geometry ( FunctionRef< void(const GeometrySet &geometry_set)> callback) const

Definition at line 79 of file geometry_set_instances.cc.

◆ geometry_set_from_reference()

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 248 of file instances.cc.

◆ instances_num()

Definition at line 408 of file instances.cc.

◆ operator=() [1/2]

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

Definition at line 196 of file instances.cc.

◆ operator=() [2/2]

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

Definition at line 206 of file instances.cc.

◆ owns_direct_data()

Definition at line 418 of file instances.cc.

◆ reference_handles()

Definition at line 222 of file instances.cc.

◆ reference_handles_for_write()

◆ reference_user_counts()

Get cached user counts for every reference.

Definition at line 503 of file instances.cc.

◆ references()

◆ references_for_write()

◆ references_num()

Definition at line 413 of file instances.cc.

◆ 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 300 of file instances.cc.

◆ remove_unused_references()

◆ resize()

Resize the transform, handles, and attributes to the specified capacity.

Warning
Attribute values for newly added elements must be initialized by the caller.

Definition at line 216 of file instances.cc.

◆ tag_reference_handles_changed()

◆ transforms()

Definition at line 235 of file instances.cc.

◆ transforms_for_write()

◆ unique_ids()

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 520 of file instances.cc.


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