Blender V4.3
blender::bke::InstanceReference Class Reference

#include <BKE_instances.hh>

Public Types

enum class  Type { None , Object , Collection , GeometrySet }
 

Public Member Functions

 InstanceReference ()=default
 
 InstanceReference (GeometrySet geometry_set)
 
 InstanceReference (const InstanceReference &other)
 
void to_geometry_set (GeometrySet &r_geometry_set) const
 
StringRefNull name () const
 
bool owns_direct_data () const
 
void ensure_owns_direct_data ()
 
void count_memory (MemoryCounter &memory) const
 
uint64_t hash () const
 
#InstanceReference Inline Methods
 InstanceReference (Object &object)
 
 InstanceReference (Collection &collection)
 
 InstanceReference (std::unique_ptr< GeometrySet > geometry_set)
 
 InstanceReference (InstanceReference &&other)
 
InstanceReferenceoperator= (const InstanceReference &other)
 
InstanceReferenceoperator= (InstanceReference &&other)
 
Type type () const
 
Objectobject () const
 
Collectioncollection () const
 
GeometrySetgeometry_set ()
 
const GeometrySetgeometry_set () const
 

Friends

bool operator== (const InstanceReference &a, const InstanceReference &b)
 

Detailed Description

Holds a reference to conceptually unique geometry or a pointer to object/collection data that is instanced with a transform in #Instances.

Definition at line 53 of file BKE_instances.hh.

Member Enumeration Documentation

◆ Type

Enumerator
None 

An empty instance. This allows an InstanceReference to be default constructed without being in an invalid state. There might also be other use cases that we haven't explored much yet (such as changing the instance later on, and "disabling" some instances).

Object 
Collection 
GeometrySet 

Definition at line 55 of file BKE_instances.hh.

Constructor & Destructor Documentation

◆ InstanceReference() [1/7]

blender::bke::InstanceReference::InstanceReference ( )
default

Referenced by operator=(), and operator=().

◆ InstanceReference() [2/7]

blender::bke::InstanceReference::InstanceReference ( Object & object)
inline

Definition at line 242 of file BKE_instances.hh.

◆ InstanceReference() [3/7]

blender::bke::InstanceReference::InstanceReference ( Collection & collection)
inline

Definition at line 246 of file BKE_instances.hh.

◆ InstanceReference() [4/7]

blender::bke::InstanceReference::InstanceReference ( GeometrySet geometry_set)

Definition at line 22 of file instances.cc.

◆ InstanceReference() [5/7]

blender::bke::InstanceReference::InstanceReference ( std::unique_ptr< GeometrySet > geometry_set)
inline

Definition at line 237 of file BKE_instances.hh.

◆ InstanceReference() [6/7]

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

Definition at line 28 of file instances.cc.

◆ InstanceReference() [7/7]

blender::bke::InstanceReference::InstanceReference ( InstanceReference && other)
inline

Definition at line 251 of file BKE_instances.hh.

References None.

Member Function Documentation

◆ collection()

Collection & blender::bke::InstanceReference::collection ( ) const
inline

Definition at line 289 of file BKE_instances.hh.

References BLI_assert, and Collection.

Referenced by name(), and to_geometry_set().

◆ count_memory()

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

Definition at line 53 of file instances.cc.

References GeometrySet.

◆ ensure_owns_direct_data()

void blender::bke::InstanceReference::ensure_owns_direct_data ( )

Definition at line 36 of file instances.cc.

References GeometrySet.

Referenced by blender::bke::Instances::ensure_owns_direct_data().

◆ geometry_set() [1/2]

GeometrySet & blender::bke::InstanceReference::geometry_set ( )
inline

Definition at line 295 of file BKE_instances.hh.

References BLI_assert, and GeometrySet.

Referenced by name(), and to_geometry_set().

◆ geometry_set() [2/2]

const GeometrySet & blender::bke::InstanceReference::geometry_set ( ) const
inline

Definition at line 301 of file BKE_instances.hh.

References BLI_assert, and GeometrySet.

◆ hash()

uint64_t blender::bke::InstanceReference::hash ( ) const

Definition at line 134 of file instances.cc.

References blender::get_default_hash().

◆ name()

◆ object()

Object & blender::bke::InstanceReference::object ( ) const
inline

Definition at line 283 of file BKE_instances.hh.

References BLI_assert, and Object.

Referenced by name(), and to_geometry_set().

◆ operator=() [1/2]

InstanceReference & blender::bke::InstanceReference::operator= ( const InstanceReference & other)
inline

Definition at line 258 of file BKE_instances.hh.

References InstanceReference().

◆ operator=() [2/2]

InstanceReference & blender::bke::InstanceReference::operator= ( InstanceReference && other)
inline

Definition at line 268 of file BKE_instances.hh.

References InstanceReference().

◆ owns_direct_data()

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

Definition at line 44 of file instances.cc.

References GeometrySet.

◆ to_geometry_set()

void blender::bke::InstanceReference::to_geometry_set ( GeometrySet & r_geometry_set) const

Converts the instance reference to a geometry set, even if it was an object or collection before.

Note
Uses out-parameter to be able to use GeometrySet forward declaration.

Definition at line 85 of file instances.cc.

References blender::bke::GeometrySet::clear(), Collection, collection(), blender::bke::convert_collection_to_instances(), geometry_set(), GeometrySet, None, Object, object(), blender::bke::object_get_evaluated_geometry_set(), and blender::bke::GeometrySet::replace_instances().

◆ type()

InstanceReference::Type blender::bke::InstanceReference::type ( ) const
inline

Definition at line 278 of file BKE_instances.hh.

Friends And Related Symbol Documentation

◆ operator==

bool operator== ( const InstanceReference & a,
const InstanceReference & b )
friend

Definition at line 126 of file instances.cc.


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