Blender  V2.93
BKE_attribute.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2006 Blender Foundation.
17  * All rights reserved.
18  */
19 
25 #pragma once
26 
27 #include "BLI_sys_types.h"
28 
29 #include "BKE_customdata.h"
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 
35 struct CustomData;
36 struct CustomDataLayer;
37 struct ID;
38 struct ReportList;
39 
40 /* Attribute.domain */
41 typedef enum AttributeDomain {
42  ATTR_DOMAIN_AUTO = -1, /* Use for nodes to choose automatically based on other data. */
43  ATTR_DOMAIN_POINT = 0, /* Mesh, Hair or PointCloud Point */
44  ATTR_DOMAIN_EDGE = 1, /* Mesh Edge */
45  ATTR_DOMAIN_CORNER = 2, /* Mesh Corner */
46  ATTR_DOMAIN_FACE = 3, /* Mesh Face */
47  ATTR_DOMAIN_CURVE = 4, /* Hair Curve */
48 
51 
52 /* Attributes */
53 
54 bool BKE_id_attributes_supported(struct ID *id);
55 
56 struct CustomDataLayer *BKE_id_attribute_new(struct ID *id,
57  const char *name,
58  const int type,
59  const AttributeDomain domain,
60  struct ReportList *reports);
61 bool BKE_id_attribute_remove(struct ID *id,
62  struct CustomDataLayer *layer,
63  struct ReportList *reports);
64 
66 int BKE_id_attribute_data_length(struct ID *id, struct CustomDataLayer *layer);
67 bool BKE_id_attribute_required(struct ID *id, struct CustomDataLayer *layer);
68 bool BKE_id_attribute_rename(struct ID *id,
69  struct CustomDataLayer *layer,
70  const char *new_name,
71  struct ReportList *reports);
72 
73 int BKE_id_attributes_length(struct ID *id, const CustomDataMask mask);
74 
76 void BKE_id_attributes_active_set(struct ID *id, struct CustomDataLayer *layer);
77 int *BKE_id_attributes_active_index_p(struct ID *id);
78 
80 
81 #ifdef __cplusplus
82 }
83 #endif
int BKE_id_attribute_data_length(struct ID *id, struct CustomDataLayer *layer)
Definition: attribute.c:209
bool BKE_id_attribute_remove(struct ID *id, struct CustomDataLayer *layer, struct ReportList *reports)
Definition: attribute.c:154
struct CustomDataLayer * BKE_id_attributes_active_get(struct ID *id)
Definition: attribute.c:239
bool BKE_id_attributes_supported(struct ID *id)
Definition: attribute.c:104
int * BKE_id_attributes_active_index_p(struct ID *id)
Definition: attribute.c:293
void BKE_id_attributes_active_set(struct ID *id, struct CustomDataLayer *layer)
Definition: attribute.c:269
int BKE_id_attributes_length(struct ID *id, const CustomDataMask mask)
Definition: attribute.c:176
bool BKE_id_attribute_rename(struct ID *id, struct CustomDataLayer *layer, const char *new_name, struct ReportList *reports)
Definition: attribute.c:116
struct CustomDataLayer * BKE_id_attribute_new(struct ID *id, const char *name, const int type, const AttributeDomain domain, struct ReportList *reports)
Definition: attribute.c:137
AttributeDomain
Definition: BKE_attribute.h:41
@ ATTR_DOMAIN_NUM
Definition: BKE_attribute.h:49
@ ATTR_DOMAIN_CURVE
Definition: BKE_attribute.h:47
@ ATTR_DOMAIN_POINT
Definition: BKE_attribute.h:43
@ ATTR_DOMAIN_FACE
Definition: BKE_attribute.h:46
@ ATTR_DOMAIN_CORNER
Definition: BKE_attribute.h:45
@ ATTR_DOMAIN_AUTO
Definition: BKE_attribute.h:42
@ ATTR_DOMAIN_EDGE
Definition: BKE_attribute.h:44
CustomData * BKE_id_attributes_iterator_next_domain(struct ID *id, struct CustomDataLayer *layers)
Definition: attribute.c:310
AttributeDomain BKE_id_attribute_domain(struct ID *id, struct CustomDataLayer *layer)
Definition: attribute.c:193
bool BKE_id_attribute_required(struct ID *id, struct CustomDataLayer *layer)
Definition: attribute.c:225
CustomData interface, see also DNA_customdata_types.h.
uint64_t CustomDataMask
_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
Definition: DNA_ID.h:273
ccl_device_inline float4 mask(const int4 &mask, const float4 &a)