101 switch (
GS(
id.name)) {
115 return curves.attributes_for_write();
131 if (info[domain].customdata) {
144 const char *old_name,
145 const char *new_name,
152 if (
STREQ(new_name,
"")) {
156 if (
STREQ(old_name, new_name)) {
162 if (layer ==
nullptr) {
186 if (!info[domain].customdata) {
191 for (
int i = 0; i < cdata->
totlayer; i++) {
209 if (!name || name[0] ==
'\0') {
228 if (customdata ==
nullptr) {
241 return (index == -1) ? nullptr : &(customdata->
layers[index]);
253 return (index == -1) ? nullptr : &(customdata->
layers[index]);
291 if (!name || name[0] ==
'\0') {
322 return attributes->remove(name);
334 if (customdata ==
nullptr) {
338 for (
int i = 0; i < customdata->
totlayer; i++) {
357 domain =
static_cast<eAttrDomain>((
static_cast<int>(domain)) + 1)) {
363 if (customdata ==
nullptr) {
367 for (
int i = 0; i < customdata->
totlayer; i++) {
388 if (customdata && ((1 << (
int)domain) & domain_mask)) {
436 return info[domain].
length;
473 for (
int i = 0; i < customdata->
totlayer; i++) {
498 for (
int i = 0; i < customdata->
totlayer; i++) {
500 if (layer == active_layer) {
516 return &((
PointCloud *)
id)->attributes_active_index;
519 return &((
Mesh *)
id)->attributes_active_index;
522 return &((
Curves *)
id)->attributes_active_index;
534 bool use_next = (layers ==
nullptr);
539 if (customdata->
layers == layers) {
563 if (!customdata || !((1 << (
int)domain) & domain_mask)) {
567 for (
int i = 0; i < customdata->
totlayer; i++) {
573 if (index == lookup_index) {
574 return customdata->
layers + i;
613 if (!(domain_mask & (1 << domains[i])) || !info[domains[i]].customdata) {
618 for (
int j = 0; j < cdata->
totlayer; j++) {
626 if (layer == layer_iter) {
649 for (
int i = 0; i <
ARRAY_SIZE(domains); i++) {
650 if (!((1 << domains[i]) & domain_mask) || !info[domains[i]].
customdata) {
656 for (
int j = 0; j < cdata->
totlayer; j++) {
663 if (layer->
flag & active_flag) {
689 if (!(domain_mask2 & domain_mask) || !info[domains[i]].
customdata) {
695 for (
int j = 0; j < cdata->
totlayer; j++) {
702 layer_iter->
flag &= ~active_flag;
706 layer->
flag |= active_flag;
736 if (layer ==
nullptr) {
739 if (layer ==
nullptr) {
742 if (layer ==
nullptr) {
764 memset((
void *)me, 0,
sizeof(*me));
778 memset((
void *)pointcloud, 0,
sizeof(*pointcloud));
788 curves->geometry.point_data = vdata ? *vdata :
reset;
789 curves->geometry.curve_data = cdata ? *cdata :
reset;
796 *((
short *)r_id->
name) = id_type;
Generic geometry attributes built on CustomData.
#define ATTR_DOMAIN_MASK_COLOR
#define ATTR_DOMAIN_AS_MASK(domain)
bool BKE_curves_customdata_required(const struct Curves *curves, const char *name)
Low-level operations for curves.
CustomData interface, see also DNA_customdata_types.h.
int CustomData_get_named_layer_index(const struct CustomData *data, int type, const char *name)
#define CD_TYPE_AS_MASK(_type)
int CustomData_number_of_layers_typemask(const struct CustomData *data, eCustomDataMask mask)
void CustomData_reset(struct CustomData *data)
General operations for point clouds.
bool BKE_pointcloud_customdata_required(const struct PointCloud *pointcloud, const char *name)
void BKE_report(ReportList *reports, eReportType type, const char *message)
#define BLI_assert_unreachable()
#define BLI_assert_msg(a, msg)
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t maxncpy) ATTR_NONNULL()
char * BLI_strncpy_utf8(char *__restrict dst, const char *__restrict src, size_t maxncpy) ATTR_NONNULL(1
bool BLI_uniquename_cb(UniquenameCheckCallback unique_check, void *arg, const char *defname, char delim, char *name, size_t name_len)
#define ARRAY_HAS_ITEM(arr_item, arr_start, arr_len)
ID and Library types, which are fundamental for sdna.
#define MAX_CUSTOMDATA_LAYER_NAME
#define CD_MASK_COLOR_ALL
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
Read Guarded memory(de)allocation.
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Bright Control the brightness and contrast of the input color Vector Map an input vectors to curves
CustomDataLayer * BKE_id_attributes_color_find(const ID *id, const char *name)
CustomDataLayer * BKE_id_attribute_find(const ID *id, const char *name, const int type, const eAttrDomain domain)
void BKE_id_attribute_subset_active_set(ID *id, CustomDataLayer *layer, int active_flag, eAttrDomainMask domain_mask, eCustomDataMask mask)
eAttrDomain BKE_id_attribute_domain(const ID *id, const CustomDataLayer *layer)
CustomDataLayer * BKE_id_attribute_new(ID *id, const char *name, const int type, const eAttrDomain domain, ReportList *reports)
CustomDataLayer * BKE_id_attribute_from_index(ID *id, int lookup_index, eAttrDomainMask domain_mask, eCustomDataMask layer_mask)
bool BKE_id_attribute_remove(ID *id, const char *name, ReportList *reports)
int BKE_id_attributes_length(const ID *id, eAttrDomainMask domain_mask, eCustomDataMask mask)
int BKE_id_attribute_to_index(const ID *id, const CustomDataLayer *layer, eAttrDomainMask domain_mask, eCustomDataMask layer_mask)
void BKE_id_attributes_render_color_set(ID *id, CustomDataLayer *active_layer)
bool BKE_attribute_allow_procedural_access(const char *attribute_name)
CustomDataLayer * BKE_id_attributes_active_color_get(const ID *id)
bool BKE_id_attribute_calc_unique_name(ID *id, const char *name, char *outname)
bool BKE_id_attribute_rename(ID *id, const char *old_name, const char *new_name, ReportList *reports)
static void get_domains_types(eAttrDomain domains[ATTR_DOMAIN_NUM])
CustomDataLayer * BKE_id_attribute_duplicate(ID *id, const char *name, ReportList *reports)
int BKE_id_attribute_data_length(ID *id, CustomDataLayer *layer)
CustomDataLayer * BKE_id_attributes_active_get(ID *id)
void BKE_id_attributes_active_color_set(ID *id, CustomDataLayer *active_layer)
static void get_domains(const ID *id, DomainInfo info[ATTR_DOMAIN_NUM])
int * BKE_id_attributes_active_index_p(ID *id)
CustomDataLayer * BKE_id_attribute_search(ID *id, const char *name, const eCustomDataMask type_mask, const eAttrDomainMask domain_mask)
CustomDataLayer * BKE_id_attribute_subset_active_get(const ID *id, int active_flag, eAttrDomainMask domain_mask, eCustomDataMask mask)
bool BKE_id_attribute_required(const ID *id, const char *name)
void BKE_id_attributes_active_set(ID *id, CustomDataLayer *active_layer)
bool BKE_id_attributes_supported(const ID *id)
CustomData * BKE_id_attributes_iterator_next_domain(ID *id, CustomDataLayer *layers)
static bool unique_name_cb(void *arg, const char *name)
CustomDataLayer * BKE_id_attributes_render_color_get(const ID *id)
void BKE_id_attribute_copy_domains_temp(short id_type, const CustomData *vdata, const CustomData *edata, const CustomData *ldata, const CustomData *pdata, const CustomData *cdata, ID *r_id)
bool BM_data_layer_free_named(BMesh *bm, CustomData *data, const char *name)
void BM_data_layer_add_named(BMesh *bm, CustomData *data, int type, const char *name)
ATTR_WARN_UNUSED_RESULT BMesh * bm
static CurvesGeometry & wrap(::CurvesGeometry &dna_struct)
SyclQueue void void * src
ccl_gpu_kernel_postfix ccl_global float int int int int float bool reset
clear internal cached data and reset random seed
ccl_device_inline float4 mask(const int4 &mask, const float4 &a)
bool allow_procedural_attribute_access(StringRef attribute_name)
static std::optional< blender::bke::MutableAttributeAccessor > get_attribute_accessor_for_write(ID &id)
MutableAttributeAccessor pointcloud_attributes_for_write(PointCloud &pointcloud)
eCustomDataType cpp_type_to_custom_data_type(const blender::CPPType &type)
MutableAttributeAccessor mesh_attributes_for_write(Mesh &mesh)
T length(const vec_base< T, Size > &a)
struct BMEditMesh * edit_mesh