Blender  V3.3
Public Member Functions | Public Attributes | List of all members
blender::bke::CustomDataAttributes Class Reference

#include <BKE_attribute.hh>

Public Member Functions

 CustomDataAttributes ()
 
 ~CustomDataAttributes ()
 
 CustomDataAttributes (const CustomDataAttributes &other)
 
 CustomDataAttributes (CustomDataAttributes &&other)
 
CustomDataAttributesoperator= (const CustomDataAttributes &other)
 
void reallocate (int size)
 
void clear ()
 
std::optional< blender::GSpanget_for_read (const AttributeIDRef &attribute_id) const
 
blender::GVArray get_for_read (const AttributeIDRef &attribute_id, eCustomDataType data_type, const void *default_value) const
 
template<typename T >
blender::VArray< Tget_for_read (const AttributeIDRef &attribute_id, const T &default_value) const
 
std::optional< blender::GMutableSpanget_for_write (const AttributeIDRef &attribute_id)
 
bool create (const AttributeIDRef &attribute_id, eCustomDataType data_type)
 
bool create_by_move (const AttributeIDRef &attribute_id, eCustomDataType data_type, void *buffer)
 
bool remove (const AttributeIDRef &attribute_id)
 
void reorder (Span< AttributeIDRef > new_order)
 
bool foreach_attribute (const AttributeForeachCallback callback, eAttrDomain domain) const
 

Public Attributes

CustomData data
 

Detailed Description

A basic container around DNA CustomData so that its users don't have to implement special copy and move constructors.

Definition at line 696 of file BKE_attribute.hh.

Constructor & Destructor Documentation

◆ CustomDataAttributes() [1/3]

blender::bke::CustomDataAttributes::CustomDataAttributes ( )

Definition at line 643 of file attribute_access.cc.

References CustomData_reset(), and data.

◆ ~CustomDataAttributes()

blender::bke::CustomDataAttributes::~CustomDataAttributes ( )

Definition at line 649 of file attribute_access.cc.

References CustomData_free(), and data.

◆ CustomDataAttributes() [2/3]

blender::bke::CustomDataAttributes::CustomDataAttributes ( const CustomDataAttributes other)

Definition at line 654 of file attribute_access.cc.

References CD_DUPLICATE, CD_MASK_ALL, CustomData_copy(), and data.

◆ CustomDataAttributes() [3/3]

blender::bke::CustomDataAttributes::CustomDataAttributes ( CustomDataAttributes &&  other)

Definition at line 660 of file attribute_access.cc.

References CustomData_reset(), and data.

Member Function Documentation

◆ clear()

void blender::bke::CustomDataAttributes::clear ( )

Definition at line 757 of file attribute_access.cc.

References CustomData_free(), and data.

Referenced by InstancesComponent::clear().

◆ create()

bool blender::bke::CustomDataAttributes::create ( const AttributeIDRef attribute_id,
eCustomDataType  data_type 
)

◆ create_by_move()

bool blender::bke::CustomDataAttributes::create_by_move ( const AttributeIDRef attribute_id,
eCustomDataType  data_type,
void buffer 
)

◆ foreach_attribute()

bool blender::bke::CustomDataAttributes::foreach_attribute ( const AttributeForeachCallback  callback,
eAttrDomain  domain 
) const

◆ get_for_read() [1/3]

std::optional< GSpan > blender::bke::CustomDataAttributes::get_for_read ( const AttributeIDRef attribute_id) const

◆ get_for_read() [2/3]

template<typename T >
blender::VArray<T> blender::bke::CustomDataAttributes::get_for_read ( const AttributeIDRef attribute_id,
const T default_value 
) const
inline

◆ get_for_read() [3/3]

GVArray blender::bke::CustomDataAttributes::get_for_read ( const AttributeIDRef attribute_id,
eCustomDataType  data_type,
const void default_value 
) const

Return a virtual array for a stored attribute, or a single value virtual array with the default value if the attribute doesn't exist. If no default value is provided, the default value for the type will be used.

Definition at line 689 of file attribute_access.cc.

References attribute, blender::bke::custom_data_type_to_cpp_type(), blender::bke::domain_num(), blender::GVArray::ForSingle(), blender::GVArray::ForSpan(), get_for_read(), blender::bke::get_implicit_type_conversions(), blender::bke::DataTypeConversions::try_convert(), and type.

◆ get_for_write()

std::optional< GMutableSpan > blender::bke::CustomDataAttributes::get_for_write ( const AttributeIDRef attribute_id)

◆ operator=()

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

Definition at line 667 of file attribute_access.cc.

References CD_DUPLICATE, CD_MASK_ALL, CustomData_copy(), and data.

◆ reallocate()

void blender::bke::CustomDataAttributes::reallocate ( int  size)

◆ remove()

bool blender::bke::CustomDataAttributes::remove ( const AttributeIDRef attribute_id)

◆ reorder()

void blender::bke::CustomDataAttributes::reorder ( Span< AttributeIDRef new_order)

Member Data Documentation

◆ data

CustomData blender::bke::CustomDataAttributes::data

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