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

#include <BKE_attribute.hh>

Inheritance diagram for blender::bke::AttributeInitMove:
blender::bke::AttributeInit

Public Member Functions

 AttributeInitMove (void *data)
 
- Public Member Functions inherited from blender::bke::AttributeInit
 AttributeInit (const Type type)
 

Public Attributes

voiddata = nullptr
 
- Public Attributes inherited from blender::bke::AttributeInit
Type type
 

Additional Inherited Members

- Public Types inherited from blender::bke::AttributeInit
enum class  Type { Default , VArray , MoveArray }
 

Detailed Description

Create an attribute with a by passing ownership of a pre-allocated contiguous array of data. Sometimes data is created before a geometry component is available. In that case, it's preferable to move data directly to the created attribute to avoid a new allocation and a copy.

Note that this will only have a benefit for attributes that are stored directly as contiguous arrays, so not for some built-in attributes.

The array must be allocated with MEM_*, since attribute_try_create will free the array if it can't be used directly, and that is generally how Blender expects custom data to be allocated.

Definition at line 120 of file BKE_attribute.hh.

Constructor & Destructor Documentation

◆ AttributeInitMove()

blender::bke::AttributeInitMove::AttributeInitMove ( void data)
inline

Definition at line 123 of file BKE_attribute.hh.

Member Data Documentation

◆ data

void* blender::bke::AttributeInitMove::data = nullptr

Definition at line 121 of file BKE_attribute.hh.


The documentation for this struct was generated from the following file: