Blender V5.0
BKE_attribute.h File Reference

Generic geometry attributes built on CustomData. More...

#include <optional>
#include <string>
#include "BLI_string_ref.hh"
#include "BLI_sys_types.h"
#include "DNA_customdata_types.h"

Go to the source code of this file.

Classes

class  AttributeOwner

Namespaces

namespace  blender
namespace  blender::bke

Macros

#define ATTR_DOMAIN_AS_MASK(domain)
#define ATTR_DOMAIN_MASK_COLOR   ((AttrDomainMask)((ATTR_DOMAIN_MASK_POINT | ATTR_DOMAIN_MASK_CORNER)))

Typedefs

typedef enum AttrDomainMask AttrDomainMask

Enumerations

enum  AttrDomainMask {
  ATTR_DOMAIN_MASK_POINT = (1 << 0) , ATTR_DOMAIN_MASK_EDGE = (1 << 1) , ATTR_DOMAIN_MASK_FACE = (1 << 2) , ATTR_DOMAIN_MASK_CORNER = (1 << 3) ,
  ATTR_DOMAIN_MASK_CURVE = (1 << 4) , ATTR_DOMAIN_MASK_GREASE_PENCIL_LAYER = (1 << 6) , ATTR_DOMAIN_MASK_ALL = (1 << 7) - 1
}
enum class  AttributeOwnerType {
  Mesh , PointCloud , Curves , GreasePencil ,
  GreasePencilDrawing
}

Functions

 ENUM_OPERATORS (AttrDomainMask, ATTR_DOMAIN_MASK_ALL)
struct CustomDataLayerBKE_attribute_new (AttributeOwner &owner, blender::StringRef name, eCustomDataType type, blender::bke::AttrDomain domain, struct ReportList *reports)
bool BKE_attribute_remove (AttributeOwner &owner, blender::StringRef name, struct ReportList *reports)
struct CustomDataLayerBKE_attribute_duplicate (AttributeOwner &owner, blender::StringRef name, struct ReportList *reports)
struct CustomDataLayerBKE_attribute_find (const AttributeOwner &owner, blender::StringRef name, eCustomDataType type, blender::bke::AttrDomain domain)
const struct CustomDataLayerBKE_attribute_search (const AttributeOwner &owner, blender::StringRef name, eCustomDataMask type, AttrDomainMask domain_mask)
struct CustomDataLayerBKE_attribute_search_for_write (AttributeOwner &owner, blender::StringRef name, eCustomDataMask type, AttrDomainMask domain_mask)
blender::bke::AttrDomain BKE_attribute_domain (const AttributeOwner &owner, const struct CustomDataLayer *layer)
int BKE_attribute_domain_size (const AttributeOwner &owner, int domain)
int BKE_attribute_data_length (AttributeOwner &owner, struct CustomDataLayer *layer)
bool BKE_attribute_required (const AttributeOwner &owner, blender::StringRef name)
bool BKE_attribute_rename (AttributeOwner &owner, blender::StringRef old_name, blender::StringRef new_name, struct ReportList *reports)
int BKE_attributes_length (const AttributeOwner &owner, AttrDomainMask domain_mask, eCustomDataMask mask)
std::optional< blender::StringRefNullBKE_attributes_active_name_get (AttributeOwner &owner)
void BKE_attributes_active_set (AttributeOwner &owner, blender::StringRef name)
void BKE_attributes_active_clear (AttributeOwner &owner)
int * BKE_attributes_active_index_p (AttributeOwner &owner)
CustomDataBKE_attributes_iterator_next_domain (AttributeOwner &owner, struct CustomDataLayer *layers)
CustomDataLayerBKE_attribute_from_index (AttributeOwner &owner, int lookup_index, AttrDomainMask domain_mask, eCustomDataMask layer_mask)
int BKE_attribute_to_index (const AttributeOwner &owner, const CustomDataLayer *layer, AttrDomainMask domain_mask, eCustomDataMask layer_mask)
std::optional< blender::StringRefBKE_id_attributes_active_color_name (const struct ID *id)
std::optional< blender::StringRefBKE_id_attributes_default_color_name (const struct ID *id)
void BKE_id_attributes_active_color_set (struct ID *id, std::optional< blender::StringRef > name)
void BKE_id_attributes_active_color_clear (struct ID *id)
void BKE_id_attributes_default_color_set (struct ID *id, std::optional< blender::StringRef > name)
const struct CustomDataLayerBKE_id_attributes_color_find (const struct ID *id, blender::StringRef name)
bool BKE_color_attribute_supported (const struct Mesh &mesh, blender::StringRef name)
std::string BKE_attribute_calc_unique_name (const AttributeOwner &owner, blender::StringRef name)
blender::StringRef BKE_uv_map_pin_name_get (blender::StringRef uv_map_name, char *buffer)

Detailed Description

Generic geometry attributes built on CustomData.

Definition in file BKE_attribute.h.

Macro Definition Documentation

◆ ATTR_DOMAIN_AS_MASK

◆ ATTR_DOMAIN_MASK_COLOR

Typedef Documentation

◆ AttrDomainMask

Enumeration Type Documentation

◆ AttrDomainMask

Enumerator
ATTR_DOMAIN_MASK_POINT 
ATTR_DOMAIN_MASK_EDGE 
ATTR_DOMAIN_MASK_FACE 
ATTR_DOMAIN_MASK_CORNER 
ATTR_DOMAIN_MASK_CURVE 
ATTR_DOMAIN_MASK_GREASE_PENCIL_LAYER 
ATTR_DOMAIN_MASK_ALL 

Definition at line 36 of file BKE_attribute.h.

◆ AttributeOwnerType

enum class AttributeOwnerType
strong
Enumerator
Mesh 
PointCloud 
Curves 
GreasePencil 
GreasePencilDrawing 

Definition at line 47 of file BKE_attribute.h.

Function Documentation

◆ BKE_attribute_calc_unique_name()

◆ BKE_attribute_data_length()

◆ BKE_attribute_domain()

◆ BKE_attribute_domain_size()

int BKE_attribute_domain_size ( const AttributeOwner & owner,
int domain )

Definition at line 733 of file attribute.cc.

References get_domains().

◆ BKE_attribute_duplicate()

◆ BKE_attribute_find()

◆ BKE_attribute_from_index()

◆ BKE_attribute_new()

◆ BKE_attribute_remove()

◆ BKE_attribute_rename()

◆ BKE_attribute_required()

◆ BKE_attribute_search()

◆ BKE_attribute_search_for_write()

◆ BKE_attribute_to_index()

int BKE_attribute_to_index ( const AttributeOwner & owner,
const CustomDataLayer * layer,
AttrDomainMask domain_mask,
eCustomDataMask layer_mask )

◆ BKE_attributes_active_clear()

void BKE_attributes_active_clear ( AttributeOwner & owner)

Definition at line 847 of file attribute.cc.

References BKE_attributes_active_index_p().

◆ BKE_attributes_active_index_p()

◆ BKE_attributes_active_name_get()

std::optional< blender::StringRefNull > BKE_attributes_active_name_get ( AttributeOwner & owner)

Definition at line 784 of file attribute.cc.

References blender::bke::allow_procedural_attribute_access(), blender::bke::AttributeStorage::at_index(), ATTR_DOMAIN_MASK_ALL, ATTR_DOMAIN_NUM, BKE_attributes_active_index_p(), BKE_attributes_length(), CD_MASK_PROP_ALL, CD_TYPE_AS_MASK(), blender::IndexRange::contains(), blender::bke::AttributeStorage::count(), get_domains(), AttributeOwner::get_storage(), i, CustomData::layers, Mesh, blender::bke::Attribute::name(), CustomDataLayer::name, CustomData::totlayer, AttributeOwner::type(), and CustomDataLayer::type.

Referenced by blender::ed::geometry::attribute_set_poll(), blender::ed::geometry::convert_attribute(), blender::ed::curves::set_selection_domain::curves_set_selection_domain_exec(), edbm_select_by_attribute_exec(), edbm_select_by_attribute_poll(), blender::ed::geometry::geometry_attribute_convert_exec(), blender::ed::geometry::geometry_attribute_convert_invoke(), blender::ed::geometry::geometry_attribute_convert_poll(), blender::ed::geometry::geometry_attribute_remove_exec(), blender::ed::geometry::geometry_attributes_remove_poll(), blender::ed::mesh::set_attribute::mesh_set_attribute_exec(), blender::ed::mesh::set_attribute::mesh_set_attribute_invoke(), blender::ed::mesh::set_attribute::mesh_set_attribute_ui(), blender::ed::curves::set_attribute_exec(), blender::ed::pointcloud::set_attribute_exec(), blender::ed::curves::set_attribute_invoke(), blender::ed::pointcloud::set_attribute_invoke(), blender::ed::curves::set_attribute_ui(), and blender::ed::pointcloud::set_attribute_ui().

◆ BKE_attributes_active_set()

◆ BKE_attributes_iterator_next_domain()

CustomData * BKE_attributes_iterator_next_domain ( AttributeOwner & owner,
struct CustomDataLayer * layers )

Definition at line 874 of file attribute.cc.

References ATTR_DOMAIN_NUM, get_domains(), CustomData::layers, and CustomData::totlayer.

◆ BKE_attributes_length()

int BKE_attributes_length ( const AttributeOwner & owner,
AttrDomainMask domain_mask,
eCustomDataMask mask )

◆ BKE_color_attribute_supported()

bool BKE_color_attribute_supported ( const struct Mesh & mesh,
blender::StringRef name )

◆ BKE_id_attributes_active_color_clear()

void BKE_id_attributes_active_color_clear ( struct ID * id)

Definition at line 1001 of file attribute.cc.

References GS, ID_ME, and MEM_SAFE_FREE.

◆ BKE_id_attributes_active_color_name()

◆ BKE_id_attributes_active_color_set()

◆ BKE_id_attributes_color_find()

◆ BKE_id_attributes_default_color_name()

◆ BKE_id_attributes_default_color_set()

◆ BKE_uv_map_pin_name_get()

◆ ENUM_OPERATORS()

ENUM_OPERATORS ( AttrDomainMask ,
ATTR_DOMAIN_MASK_ALL  )

References ATTR_DOMAIN_MASK_ALL.