Blender  V3.3
rna_attribute.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
7 #include <stdlib.h>
8 
9 #include "RNA_access.h"
10 #include "RNA_define.h"
11 #include "RNA_enum_types.h"
12 
13 #include "rna_internal.h"
14 
15 #include "DNA_curves_types.h"
16 #include "DNA_customdata_types.h"
17 #include "DNA_mesh_types.h"
18 #include "DNA_meshdata_types.h"
19 #include "DNA_pointcloud_types.h"
20 
21 #include "BKE_attribute.h"
22 #include "BKE_customdata.h"
23 
24 #include "WM_types.h"
25 
27  {CD_PROP_FLOAT, "FLOAT", 0, "Float", "Floating-point value"},
28  {CD_PROP_INT32, "INT", 0, "Integer", "32-bit integer"},
29  {CD_PROP_FLOAT3, "FLOAT_VECTOR", 0, "Vector", "3D vector with floating-point values"},
30  {CD_PROP_COLOR, "FLOAT_COLOR", 0, "Color", "RGBA color with 32-bit floating-point values"},
32  "BYTE_COLOR",
33  0,
34  "Byte Color",
35  "RGBA color with 8-bit positive integer values"},
36  {CD_PROP_STRING, "STRING", 0, "String", "Text string"},
37  {CD_PROP_BOOL, "BOOLEAN", 0, "Boolean", "True or false"},
38  {CD_PROP_FLOAT2, "FLOAT2", 0, "2D Vector", "2D vector with floating-point values"},
39  {CD_PROP_INT8, "INT8", 0, "8-Bit Integer", "Smaller integer with a range from -128 to 127"},
40  {0, NULL, 0, NULL, NULL},
41 };
42 
44  {CD_PROP_COLOR, "FLOAT_COLOR", 0, "Color", "RGBA color 32-bit floating-point values"},
46  "BYTE_COLOR",
47  0,
48  "Byte Color",
49  "RGBA color with 8-bit positive integer values"},
50  {0, NULL, 0, NULL, NULL}};
51 
53  {CD_AUTO_FROM_NAME, "AUTO", 0, "Auto", ""},
54  {CD_PROP_FLOAT, "FLOAT", 0, "Float", "Floating-point value"},
55  {CD_PROP_INT32, "INT", 0, "Integer", "32-bit integer"},
56  {CD_PROP_FLOAT3, "FLOAT_VECTOR", 0, "Vector", "3D vector with floating-point values"},
57  {CD_PROP_COLOR, "FLOAT_COLOR", 0, "Color", "RGBA color with 32-bit floating-point values"},
59  "BYTE_COLOR",
60  0,
61  "Byte Color",
62  "RGBA color with 8-bit positive integer values"},
63  {CD_PROP_STRING, "STRING", 0, "String", "Text string"},
64  {CD_PROP_BOOL, "BOOLEAN", 0, "Boolean", "True or false"},
65  {CD_PROP_FLOAT2, "FLOAT2", 0, "2D Vector", "2D vector with floating-point values"},
66  {CD_PROP_INT8, "INT8", 0, "8-Bit Integer", "Smaller integer with a range from -128 to 127"},
67  {0, NULL, 0, NULL, NULL},
68 };
69 
71  /* Not implement yet */
72  // {ATTR_DOMAIN_GEOMETRY, "GEOMETRY", 0, "Geometry", "Attribute on (whole) geometry"},
73  {ATTR_DOMAIN_POINT, "POINT", 0, "Point", "Attribute on point"},
74  {ATTR_DOMAIN_EDGE, "EDGE", 0, "Edge", "Attribute on mesh edge"},
75  {ATTR_DOMAIN_FACE, "FACE", 0, "Face", "Attribute on mesh faces"},
76  {ATTR_DOMAIN_CORNER, "CORNER", 0, "Face Corner", "Attribute on mesh face corner"},
77  /* Not implement yet */
78  // {ATTR_DOMAIN_GRIDS, "GRIDS", 0, "Grids", "Attribute on mesh multires grids"},
79  {ATTR_DOMAIN_CURVE, "CURVE", 0, "Spline", "Attribute on spline"},
80  {ATTR_DOMAIN_INSTANCE, "INSTANCE", 0, "Instance", "Attribute on instance"},
81  {0, NULL, 0, NULL, NULL},
82 };
83 
85  {ATTR_DOMAIN_POINT, "POINT", 0, "Point", "Attribute on point"},
86  {ATTR_DOMAIN_EDGE, "EDGE", 0, "Edge", "Attribute on mesh edge"},
87  {ATTR_DOMAIN_FACE, "FACE", 0, "Face", "Attribute on mesh faces"},
88  {ATTR_DOMAIN_CURVE, "CURVE", 0, "Spline", "Attribute on spline"},
89  {ATTR_DOMAIN_INSTANCE, "INSTANCE", 0, "Instance", "Attribute on instance"},
90  {0, NULL, 0, NULL, NULL},
91 };
92 
94  {ATTR_DOMAIN_AUTO, "AUTO", 0, "Auto", ""},
95  {ATTR_DOMAIN_POINT, "POINT", 0, "Point", "Attribute on point"},
96  {ATTR_DOMAIN_EDGE, "EDGE", 0, "Edge", "Attribute on mesh edge"},
97  {ATTR_DOMAIN_FACE, "FACE", 0, "Face", "Attribute on mesh faces"},
98  {ATTR_DOMAIN_CORNER, "CORNER", 0, "Face Corner", "Attribute on mesh face corner"},
99  {ATTR_DOMAIN_CURVE, "CURVE", 0, "Spline", "Attribute on spline"},
100  {ATTR_DOMAIN_INSTANCE, "INSTANCE", 0, "Instance", "Attribute on instance"},
101  {0, NULL, 0, NULL, NULL},
102 };
103 
105  {ATTR_DOMAIN_POINT, "POINT", 0, "Vertex", ""},
106  {ATTR_DOMAIN_CORNER, "CORNER", 0, "Face Corner", ""},
107  {0, NULL, 0, NULL, NULL}};
108 
110  {ATTR_DOMAIN_POINT, "POINT", 0, "Control Point", ""},
111  {ATTR_DOMAIN_CURVE, "CURVE", 0, "Curve", ""},
112  {0, NULL, 0, NULL, NULL}};
113 
114 #ifdef RNA_RUNTIME
115 
116 # include "BLI_math.h"
117 
118 # include "DEG_depsgraph.h"
119 
120 # include "BLT_translation.h"
121 
122 # include "WM_api.h"
123 
124 /* Attribute */
125 
126 static char *rna_Attribute_path(const PointerRNA *ptr)
127 {
128  const CustomDataLayer *layer = ptr->data;
129  return BLI_sprintfN("attributes['%s']", layer->name);
130 }
131 
132 static StructRNA *srna_by_custom_data_layer_type(const eCustomDataType type)
133 {
134  switch (type) {
135  case CD_PROP_FLOAT:
136  return &RNA_FloatAttribute;
137  case CD_PROP_INT32:
138  return &RNA_IntAttribute;
139  case CD_PROP_FLOAT3:
140  return &RNA_FloatVectorAttribute;
141  case CD_PROP_COLOR:
142  return &RNA_FloatColorAttribute;
143  case CD_PROP_BYTE_COLOR:
144  return &RNA_ByteColorAttribute;
145  case CD_PROP_STRING:
146  return &RNA_StringAttribute;
147  case CD_PROP_BOOL:
148  return &RNA_BoolAttribute;
149  case CD_PROP_FLOAT2:
150  return &RNA_Float2Attribute;
151  case CD_PROP_INT8:
152  return &RNA_ByteIntAttribute;
153  default:
154  return NULL;
155  }
156 }
157 
158 static StructRNA *rna_Attribute_refine(PointerRNA *ptr)
159 {
160  CustomDataLayer *layer = ptr->data;
161  return srna_by_custom_data_layer_type(layer->type);
162 }
163 
164 static void rna_Attribute_name_set(PointerRNA *ptr, const char *value)
165 {
166  const CustomDataLayer *layer = (const CustomDataLayer *)ptr->data;
167  BKE_id_attribute_rename(ptr->owner_id, layer->name, value, NULL);
168 }
169 
170 static int rna_Attribute_name_editable(PointerRNA *ptr, const char **r_info)
171 {
172  CustomDataLayer *layer = ptr->data;
173  if (BKE_id_attribute_required(ptr->owner_id, layer->name)) {
174  *r_info = N_("Cannot modify name of required geometry attribute");
175  return false;
176  }
177 
178  return true;
179 }
180 
181 static int rna_Attribute_type_get(PointerRNA *ptr)
182 {
183  CustomDataLayer *layer = ptr->data;
184  return layer->type;
185 }
186 
188  bool include_instances,
189  bool *r_free)
190 {
191  EnumPropertyItem *item = NULL;
192  const EnumPropertyItem *domain_item = NULL;
193  const ID_Type id_type = GS(id->name);
194  int totitem = 0, a;
195 
196  static EnumPropertyItem mesh_vertex_domain_item = {
197  ATTR_DOMAIN_POINT, "POINT", 0, "Vertex", "Attribute per point/vertex"};
198 
200  domain_item = &rna_enum_attribute_domain_items[a];
201 
202  if (id_type == ID_PT && !ELEM(domain_item->value, ATTR_DOMAIN_POINT)) {
203  continue;
204  }
205  if (id_type == ID_CV && !ELEM(domain_item->value, ATTR_DOMAIN_POINT, ATTR_DOMAIN_CURVE)) {
206  continue;
207  }
208  if (id_type == ID_ME && ELEM(domain_item->value, ATTR_DOMAIN_CURVE)) {
209  continue;
210  }
211  if (!include_instances && domain_item->value == ATTR_DOMAIN_INSTANCE) {
212  continue;
213  }
214 
215  if (domain_item->value == ATTR_DOMAIN_POINT && id_type == ID_ME) {
216  RNA_enum_item_add(&item, &totitem, &mesh_vertex_domain_item);
217  }
218  else {
219  RNA_enum_item_add(&item, &totitem, domain_item);
220  }
221  }
222  RNA_enum_item_end(&item, &totitem);
223 
224  *r_free = true;
225  return item;
226 }
227 
228 static const EnumPropertyItem *rna_Attribute_domain_itemf(bContext *UNUSED(C),
229  PointerRNA *ptr,
230  PropertyRNA *UNUSED(prop),
231  bool *r_free)
232 {
233  return rna_enum_attribute_domain_itemf(ptr->owner_id, true, r_free);
234 }
235 
236 static int rna_Attribute_domain_get(PointerRNA *ptr)
237 {
239 }
240 
241 static bool rna_Attribute_is_internal_get(PointerRNA *ptr)
242 {
243  const CustomDataLayer *layer = (const CustomDataLayer *)ptr->data;
245 }
246 
247 static void rna_Attribute_data_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
248 {
249  ID *id = ptr->owner_id;
251 
252  int length = BKE_id_attribute_data_length(id, layer);
253  size_t struct_size;
254 
255  switch (layer->type) {
256  case CD_PROP_FLOAT:
257  struct_size = sizeof(MFloatProperty);
258  break;
259  case CD_PROP_INT32:
260  struct_size = sizeof(MIntProperty);
261  break;
262  case CD_PROP_FLOAT3:
263  struct_size = sizeof(float[3]);
264  break;
265  case CD_PROP_COLOR:
266  struct_size = sizeof(MPropCol);
267  break;
268  case CD_PROP_BYTE_COLOR:
269  struct_size = sizeof(MLoopCol);
270  break;
271  case CD_PROP_STRING:
272  struct_size = sizeof(MStringProperty);
273  break;
274  case CD_PROP_BOOL:
275  struct_size = sizeof(MBoolProperty);
276  break;
277  case CD_PROP_FLOAT2:
278  struct_size = sizeof(float[2]);
279  break;
280  case CD_PROP_INT8:
281  struct_size = sizeof(int8_t);
282  break;
283  default:
284  struct_size = 0;
285  length = 0;
286  break;
287  }
288 
289  rna_iterator_array_begin(iter, layer->data, struct_size, length, 0, NULL);
290 }
291 
292 static int rna_Attribute_data_length(PointerRNA *ptr)
293 {
294  ID *id = ptr->owner_id;
296  return BKE_id_attribute_data_length(id, layer);
297 }
298 
299 static void rna_Attribute_update_data(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
300 {
301  ID *id = ptr->owner_id;
302 
303  /* cheating way for importers to avoid slow updates */
304  if (id->us > 0) {
305  DEG_id_tag_update(id, 0);
307  }
308 }
309 
310 /* Color Attribute */
311 
312 static void rna_ByteColorAttributeValue_color_get(PointerRNA *ptr, float *values)
313 {
314  MLoopCol *mlcol = (MLoopCol *)ptr->data;
315  srgb_to_linearrgb_uchar4(values, &mlcol->r);
316 }
317 
318 static void rna_ByteColorAttributeValue_color_set(PointerRNA *ptr, const float *values)
319 {
320  MLoopCol *mlcol = (MLoopCol *)ptr->data;
321  linearrgb_to_srgb_uchar4(&mlcol->r, values);
322 }
323 
324 /* Int8 Attribute. */
325 
326 static int rna_ByteIntAttributeValue_get(PointerRNA *ptr)
327 {
328  int8_t *value = (int8_t *)ptr->data;
329  return (int)(*value);
330 }
331 
332 static void rna_ByteIntAttributeValue_set(PointerRNA *ptr, const int new_value)
333 {
334  int8_t *value = (int8_t *)ptr->data;
335  if (new_value > INT8_MAX) {
336  *value = INT8_MAX;
337  }
338  else if (new_value < INT8_MIN) {
339  *value = INT8_MIN;
340  }
341  else {
342  *value = (int8_t)new_value;
343  }
344 }
345 
346 /* Attribute Group */
347 
348 static PointerRNA rna_AttributeGroup_new(
349  ID *id, ReportList *reports, const char *name, const int type, const int domain)
350 {
351  CustomDataLayer *layer = BKE_id_attribute_new(id, name, type, domain, reports);
354 
355  PointerRNA ptr;
356  RNA_pointer_create(id, &RNA_Attribute, layer, &ptr);
357  return ptr;
358 }
359 
360 static void rna_AttributeGroup_remove(ID *id, ReportList *reports, PointerRNA *attribute_ptr)
361 {
362  const CustomDataLayer *layer = (const CustomDataLayer *)attribute_ptr->data;
363  BKE_id_attribute_remove(id, layer->name, reports);
364  RNA_POINTER_INVALIDATE(attribute_ptr);
365 
368 }
369 
370 static int rna_Attributes_layer_skip(CollectionPropertyIterator *UNUSED(iter), void *data)
371 {
373  return !(CD_TYPE_AS_MASK(layer->type) & CD_MASK_PROP_ALL);
374 }
375 
376 static int rna_Attributes_noncolor_layer_skip(CollectionPropertyIterator *iter, void *data)
377 {
379 
380  /* Check valid domain here, too, keep in line with rna_AttributeGroup_color_length(). */
381  ID *id = iter->parent.owner_id;
382  eAttrDomain domain = BKE_id_attribute_domain(id, layer);
383  if (!ELEM(domain, ATTR_DOMAIN_POINT, ATTR_DOMAIN_CORNER)) {
384  return 1;
385  }
386 
387  return !(CD_TYPE_AS_MASK(layer->type) & CD_MASK_COLOR_ALL) || (layer->flag & CD_FLAG_TEMPORARY);
388 }
389 
390 /* Attributes are spread over multiple domains in separate CustomData, we use repeated
391  * array iterators to loop over all. */
392 static void rna_AttributeGroup_next_domain(ID *id,
394  int(skip)(CollectionPropertyIterator *iter, void *data))
395 {
396  do {
397  CustomDataLayer *prev_layers = (iter->internal.array.endptr == NULL) ?
398  NULL :
400  iter->internal.array.length;
401  CustomData *customdata = BKE_id_attributes_iterator_next_domain(id, prev_layers);
402  if (customdata == NULL) {
403  return;
404  }
406  iter, customdata->layers, sizeof(CustomDataLayer), customdata->totlayer, false, skip);
407  } while (!iter->valid);
408 }
409 
411 {
412  memset(&iter->internal.array, 0, sizeof(iter->internal.array));
413  rna_AttributeGroup_next_domain(ptr->owner_id, iter, rna_Attributes_layer_skip);
414 }
415 
417 {
419 
420  if (!iter->valid) {
421  ID *id = iter->parent.owner_id;
422  rna_AttributeGroup_next_domain(id, iter, rna_Attributes_layer_skip);
423  }
424 }
425 
427 {
428  /* Refine to the proper type. */
430  StructRNA *type = srna_by_custom_data_layer_type(layer->type);
431  if (type == NULL) {
432  return PointerRNA_NULL;
433  }
434  return rna_pointer_inherit_refine(&iter->parent, type, layer);
435 }
436 
438 {
439  memset(&iter->internal.array, 0, sizeof(iter->internal.array));
440  rna_AttributeGroup_next_domain(ptr->owner_id, iter, rna_Attributes_noncolor_layer_skip);
441 }
442 
444 {
446 
447  if (!iter->valid) {
448  ID *id = iter->parent.owner_id;
449  rna_AttributeGroup_next_domain(id, iter, rna_Attributes_noncolor_layer_skip);
450  }
451 }
452 
454 {
455  /* Refine to the proper type. */
457  StructRNA *type = srna_by_custom_data_layer_type(layer->type);
458  if (type == NULL) {
459  return PointerRNA_NULL;
460  }
461  return rna_pointer_inherit_refine(&iter->parent, type, layer);
462 }
463 
465 {
469 }
470 
472 {
474 }
475 
476 static int rna_AttributeGroup_active_index_get(PointerRNA *ptr)
477 {
479 }
480 
481 static PointerRNA rna_AttributeGroup_active_get(PointerRNA *ptr)
482 {
483  ID *id = ptr->owner_id;
485 
486  PointerRNA attribute_ptr;
487  RNA_pointer_create(id, &RNA_Attribute, layer, &attribute_ptr);
488  return attribute_ptr;
489 }
490 
491 static void rna_AttributeGroup_active_set(PointerRNA *ptr,
492  PointerRNA attribute_ptr,
493  ReportList *UNUSED(reports))
494 {
495  ID *id = ptr->owner_id;
496  CustomDataLayer *layer = attribute_ptr.data;
497  BKE_id_attributes_active_set(id, layer);
498 }
499 
500 static void rna_AttributeGroup_active_index_set(PointerRNA *ptr, int value)
501 {
503 }
504 
505 static void rna_AttributeGroup_active_index_range(
506  PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax)
507 {
508  *min = 0;
510 
511  *softmin = *min;
512  *softmax = *max;
513 }
514 
515 static void rna_AttributeGroup_update_active(Main *bmain, Scene *scene, PointerRNA *ptr)
516 {
517  rna_Attribute_update_data(bmain, scene, ptr);
518 }
519 
520 static PointerRNA rna_AttributeGroup_active_color_get(PointerRNA *ptr)
521 {
522  ID *id = ptr->owner_id;
524 
525  PointerRNA attribute_ptr;
526  RNA_pointer_create(id, &RNA_Attribute, layer, &attribute_ptr);
527  return attribute_ptr;
528 }
529 
530 static void rna_AttributeGroup_active_color_set(PointerRNA *ptr,
531  PointerRNA attribute_ptr,
532  ReportList *UNUSED(reports))
533 {
534  ID *id = ptr->owner_id;
535  CustomDataLayer *layer = attribute_ptr.data;
536 
538 }
539 
540 static int rna_AttributeGroup_active_color_index_get(PointerRNA *ptr)
541 {
543 
546 }
547 
548 static void rna_AttributeGroup_active_color_index_set(PointerRNA *ptr, int value)
549 {
552 
553  if (!layer) {
554  fprintf(stderr, "%s: error setting active color index to %d\n", __func__, value);
555  return;
556  }
557 
559 }
560 
561 static void rna_AttributeGroup_active_color_index_range(
562  PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax)
563 {
564  *min = 0;
566 
567  *softmin = *min;
568  *softmax = *max;
569 }
570 
571 static void rna_AttributeGroup_update_active_color(Main *UNUSED(bmain),
572  Scene *UNUSED(scene),
573  PointerRNA *ptr)
574 {
575  ID *id = ptr->owner_id;
576 
577  /* Cheating way for importers to avoid slow updates. */
578  if (id->us > 0) {
579  DEG_id_tag_update(id, 0);
581  }
582 }
583 
584 static int rna_AttributeGroup_render_color_index_get(PointerRNA *ptr)
585 {
587 
590 }
591 
592 static void rna_AttributeGroup_render_color_index_set(PointerRNA *ptr, int value)
593 {
596 
597  if (!layer) {
598  fprintf(stderr, "%s: error setting render color index to %d\n", __func__, value);
599  return;
600  }
601 
603 }
604 
605 static void rna_AttributeGroup_render_color_index_range(
606  PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax)
607 {
608  *min = 0;
610 
611  *softmin = *min;
612  *softmax = *max;
613 }
614 #else
615 
617 {
618  StructRNA *srna;
619  PropertyRNA *prop;
620 
621  srna = RNA_def_struct(brna, "FloatAttribute", "Attribute");
622  RNA_def_struct_sdna(srna, "CustomDataLayer");
624  srna, "Float Attribute", "Geometry attribute that stores floating-point values");
625 
626  prop = RNA_def_property(srna, "data", PROP_COLLECTION, PROP_NONE);
627  RNA_def_property_struct_type(prop, "FloatAttributeValue");
629  "rna_Attribute_data_begin",
630  "rna_iterator_array_next",
631  "rna_iterator_array_end",
632  "rna_iterator_array_get",
633  "rna_Attribute_data_length",
634  NULL,
635  NULL,
636  NULL);
637 
638  srna = RNA_def_struct(brna, "FloatAttributeValue", NULL);
639  RNA_def_struct_sdna(srna, "MFloatProperty");
641  srna, "Float Attribute Value", "Floating-point value in geometry attribute");
642  prop = RNA_def_property(srna, "value", PROP_FLOAT, PROP_NONE);
643  RNA_def_property_float_sdna(prop, NULL, "f");
644  RNA_def_property_update(prop, 0, "rna_Attribute_update_data");
645 }
646 
648 {
649  StructRNA *srna;
650  PropertyRNA *prop;
651 
652  /* Float Vector Attribute */
653  srna = RNA_def_struct(brna, "FloatVectorAttribute", "Attribute");
654  RNA_def_struct_sdna(srna, "CustomDataLayer");
656  srna, "Float Vector Attribute", "Geometry attribute that stores floating-point 3D vectors");
657 
658  prop = RNA_def_property(srna, "data", PROP_COLLECTION, PROP_NONE);
659  RNA_def_property_struct_type(prop, "FloatVectorAttributeValue");
661  "rna_Attribute_data_begin",
662  "rna_iterator_array_next",
663  "rna_iterator_array_end",
664  "rna_iterator_array_get",
665  "rna_Attribute_data_length",
666  NULL,
667  NULL,
668  NULL);
669 
670  /* Float Vector Attribute Value */
671  srna = RNA_def_struct(brna, "FloatVectorAttributeValue", NULL);
672  RNA_def_struct_sdna(srna, "vec3f");
674  srna, "Float Vector Attribute Value", "Vector value in geometry attribute");
675 
676  prop = RNA_def_property(srna, "vector", PROP_FLOAT, PROP_DIRECTION);
677  RNA_def_property_ui_text(prop, "Vector", "3D vector");
678  RNA_def_property_float_sdna(prop, NULL, "x");
679  RNA_def_property_array(prop, 3);
680  RNA_def_property_update(prop, 0, "rna_Attribute_update_data");
681 }
682 
684 {
685  StructRNA *srna;
686  PropertyRNA *prop;
687 
688  /* Float Color Attribute */
689  srna = RNA_def_struct(brna, "FloatColorAttribute", "Attribute");
690  RNA_def_struct_sdna(srna, "CustomDataLayer");
692  "Float Color Attribute",
693  "Geometry attribute that stores RGBA colors as floating-point values "
694  "using 32-bits per channel");
695 
696  prop = RNA_def_property(srna, "data", PROP_COLLECTION, PROP_NONE);
697  RNA_def_property_struct_type(prop, "FloatColorAttributeValue");
699  "rna_Attribute_data_begin",
700  "rna_iterator_array_next",
701  "rna_iterator_array_end",
702  "rna_iterator_array_get",
703  "rna_Attribute_data_length",
704  NULL,
705  NULL,
706  NULL);
707 
708  /* Float Color Attribute Value */
709  srna = RNA_def_struct(brna, "FloatColorAttributeValue", NULL);
710  RNA_def_struct_sdna(srna, "MPropCol");
711  RNA_def_struct_ui_text(srna, "Float Color Attribute Value", "Color value in geometry attribute");
712 
713  prop = RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR);
714  RNA_def_property_ui_text(prop, "Color", "RGBA color in scene linear color space");
715  RNA_def_property_float_sdna(prop, NULL, "color");
716  RNA_def_property_array(prop, 4);
717  RNA_def_property_update(prop, 0, "rna_Attribute_update_data");
718 }
719 
721 {
722  StructRNA *srna;
723  PropertyRNA *prop;
724 
725  /* Byte Color Attribute */
726  srna = RNA_def_struct(brna, "ByteColorAttribute", "Attribute");
727  RNA_def_struct_sdna(srna, "CustomDataLayer");
729  "Byte Color Attribute",
730  "Geometry attribute that stores RGBA colors as positive integer values "
731  "using 8-bits per channel");
732 
733  prop = RNA_def_property(srna, "data", PROP_COLLECTION, PROP_NONE);
734  RNA_def_property_struct_type(prop, "ByteColorAttributeValue");
736  "rna_Attribute_data_begin",
737  "rna_iterator_array_next",
738  "rna_iterator_array_end",
739  "rna_iterator_array_get",
740  "rna_Attribute_data_length",
741  NULL,
742  NULL,
743  NULL);
744 
745  /* Byte Color Attribute Value */
746  srna = RNA_def_struct(brna, "ByteColorAttributeValue", NULL);
747  RNA_def_struct_sdna(srna, "MLoopCol");
748  RNA_def_struct_ui_text(srna, "Byte Color Attribute Value", "Color value in geometry attribute");
749 
750  prop = RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR);
751  RNA_def_property_array(prop, 4);
752  RNA_def_property_range(prop, 0.0f, 1.0f);
754  "rna_ByteColorAttributeValue_color_get",
755  "rna_ByteColorAttributeValue_color_set",
756  NULL);
757  RNA_def_property_ui_text(prop, "Color", "RGBA color in scene linear color space");
758  RNA_def_property_update(prop, 0, "rna_Attribute_update_data");
759 }
760 
762 {
763  StructRNA *srna;
764  PropertyRNA *prop;
765 
766  srna = RNA_def_struct(brna, "IntAttribute", "Attribute");
767  RNA_def_struct_sdna(srna, "CustomDataLayer");
769  srna, "Integer Attribute", "Geometry attribute that stores integer values");
770 
771  prop = RNA_def_property(srna, "data", PROP_COLLECTION, PROP_NONE);
772  RNA_def_property_struct_type(prop, "IntAttributeValue");
774  "rna_Attribute_data_begin",
775  "rna_iterator_array_next",
776  "rna_iterator_array_end",
777  "rna_iterator_array_get",
778  "rna_Attribute_data_length",
779  NULL,
780  NULL,
781  NULL);
782 
783  srna = RNA_def_struct(brna, "IntAttributeValue", NULL);
784  RNA_def_struct_sdna(srna, "MIntProperty");
785  RNA_def_struct_ui_text(srna, "Integer Attribute Value", "Integer value in geometry attribute");
786  prop = RNA_def_property(srna, "value", PROP_INT, PROP_NONE);
787  RNA_def_property_int_sdna(prop, NULL, "i");
788  RNA_def_property_update(prop, 0, "rna_Attribute_update_data");
789 }
790 
792 {
793  StructRNA *srna;
794  PropertyRNA *prop;
795 
796  srna = RNA_def_struct(brna, "StringAttribute", "Attribute");
797  RNA_def_struct_sdna(srna, "CustomDataLayer");
798  RNA_def_struct_ui_text(srna, "String Attribute", "Geometry attribute that stores strings");
799 
800  prop = RNA_def_property(srna, "data", PROP_COLLECTION, PROP_NONE);
801  RNA_def_property_struct_type(prop, "StringAttributeValue");
803  "rna_Attribute_data_begin",
804  "rna_iterator_array_next",
805  "rna_iterator_array_end",
806  "rna_iterator_array_get",
807  "rna_Attribute_data_length",
808  NULL,
809  NULL,
810  NULL);
811 
812  srna = RNA_def_struct(brna, "StringAttributeValue", NULL);
813  RNA_def_struct_sdna(srna, "MStringProperty");
814  RNA_def_struct_ui_text(srna, "String Attribute Value", "String value in geometry attribute");
815  prop = RNA_def_property(srna, "value", PROP_STRING, PROP_NONE);
817  RNA_def_property_update(prop, 0, "rna_Attribute_update_data");
818 }
819 
821 {
822  StructRNA *srna;
823  PropertyRNA *prop;
824 
825  srna = RNA_def_struct(brna, "BoolAttribute", "Attribute");
826  RNA_def_struct_sdna(srna, "CustomDataLayer");
827  RNA_def_struct_ui_text(srna, "Bool Attribute", "Geometry attribute that stores booleans");
828 
829  prop = RNA_def_property(srna, "data", PROP_COLLECTION, PROP_NONE);
830  RNA_def_property_struct_type(prop, "BoolAttributeValue");
832  "rna_Attribute_data_begin",
833  "rna_iterator_array_next",
834  "rna_iterator_array_end",
835  "rna_iterator_array_get",
836  "rna_Attribute_data_length",
837  NULL,
838  NULL,
839  NULL);
840 
841  srna = RNA_def_struct(brna, "BoolAttributeValue", NULL);
842  RNA_def_struct_sdna(srna, "MBoolProperty");
843  RNA_def_struct_ui_text(srna, "Bool Attribute Value", "Bool value in geometry attribute");
844  prop = RNA_def_property(srna, "value", PROP_BOOLEAN, PROP_NONE);
845  RNA_def_property_boolean_sdna(prop, NULL, "b", 0x01);
846 }
847 
849 {
850  StructRNA *srna;
851  PropertyRNA *prop;
852 
853  srna = RNA_def_struct(brna, "ByteIntAttribute", "Attribute");
854  RNA_def_struct_sdna(srna, "CustomDataLayer");
856  srna, "8-bit Integer Attribute", "Geometry attribute that stores 8-bit integers");
857 
858  prop = RNA_def_property(srna, "data", PROP_COLLECTION, PROP_NONE);
859  RNA_def_property_struct_type(prop, "ByteIntAttributeValue");
861  "rna_Attribute_data_begin",
862  "rna_iterator_array_next",
863  "rna_iterator_array_end",
864  "rna_iterator_array_get",
865  "rna_Attribute_data_length",
866  NULL,
867  NULL,
868  NULL);
869 
870  srna = RNA_def_struct(brna, "ByteIntAttributeValue", NULL);
871  RNA_def_struct_sdna(srna, "MInt8Property");
873  srna, "8-bit Integer Attribute Value", "8-bit value in geometry attribute");
874  prop = RNA_def_property(srna, "value", PROP_INT, PROP_NONE);
876  prop, "rna_ByteIntAttributeValue_get", "rna_ByteIntAttributeValue_set", NULL);
877 }
878 
880 {
881  StructRNA *srna;
882  PropertyRNA *prop;
883 
884  /* Float2 Attribute */
885  srna = RNA_def_struct(brna, "Float2Attribute", "Attribute");
886  RNA_def_struct_sdna(srna, "CustomDataLayer");
888  srna, "Float2 Attribute", "Geometry attribute that stores floating-point 2D vectors");
889 
890  prop = RNA_def_property(srna, "data", PROP_COLLECTION, PROP_NONE);
891  RNA_def_property_struct_type(prop, "Float2AttributeValue");
893  "rna_Attribute_data_begin",
894  "rna_iterator_array_next",
895  "rna_iterator_array_end",
896  "rna_iterator_array_get",
897  "rna_Attribute_data_length",
898  NULL,
899  NULL,
900  NULL);
901 
902  /* Float2 Attribute Value */
903  srna = RNA_def_struct(brna, "Float2AttributeValue", NULL);
904  RNA_def_struct_sdna(srna, "vec2f");
905  RNA_def_struct_ui_text(srna, "Float2 Attribute Value", "2D Vector value in geometry attribute");
906 
907  prop = RNA_def_property(srna, "vector", PROP_FLOAT, PROP_DIRECTION);
908  RNA_def_property_ui_text(prop, "Vector", "2D vector");
909  RNA_def_property_float_sdna(prop, NULL, "x");
910  RNA_def_property_array(prop, 2);
911  RNA_def_property_update(prop, 0, "rna_Attribute_update_data");
912 }
913 
914 static void rna_def_attribute(BlenderRNA *brna)
915 {
916  PropertyRNA *prop;
917  StructRNA *srna;
918 
919  srna = RNA_def_struct(brna, "Attribute", NULL);
920  RNA_def_struct_sdna(srna, "CustomDataLayer");
921  RNA_def_struct_ui_text(srna, "Attribute", "Geometry attribute");
922  RNA_def_struct_path_func(srna, "rna_Attribute_path");
923  RNA_def_struct_refine_func(srna, "rna_Attribute_refine");
924 
925  prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
926  RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Attribute_name_set");
927  RNA_def_property_editable_func(prop, "rna_Attribute_name_editable");
928  RNA_def_property_ui_text(prop, "Name", "Name of the Attribute");
929  RNA_def_struct_name_property(srna, prop);
930 
931  prop = RNA_def_property(srna, "data_type", PROP_ENUM, PROP_NONE);
932  RNA_def_property_enum_sdna(prop, NULL, "type");
934  RNA_def_property_enum_funcs(prop, "rna_Attribute_type_get", NULL, NULL);
935  RNA_def_property_ui_text(prop, "Data Type", "Type of data stored in attribute");
937 
938  prop = RNA_def_property(srna, "domain", PROP_ENUM, PROP_NONE);
941  prop, "rna_Attribute_domain_get", NULL, "rna_Attribute_domain_itemf");
942  RNA_def_property_ui_text(prop, "Domain", "Domain of the Attribute");
944 
945  prop = RNA_def_property(srna, "is_internal", PROP_BOOLEAN, PROP_NONE);
946  RNA_def_property_boolean_funcs(prop, "rna_Attribute_is_internal_get", NULL);
948  prop, "Is Internal", "The attribute is meant for internal use by Blender");
950 
951  /* types */
956  rna_def_attribute_int(brna);
961 }
962 
963 /* Mesh/PointCloud/Curves.attributes */
965 {
966  StructRNA *srna;
967  PropertyRNA *prop;
968  FunctionRNA *func;
969  PropertyRNA *parm;
970 
971  srna = RNA_def_struct(brna, "AttributeGroup", NULL);
972  RNA_def_struct_ui_text(srna, "Attribute Group", "Group of geometry attributes");
973  RNA_def_struct_sdna(srna, "ID");
974 
975  /* API */
976  func = RNA_def_function(srna, "new", "rna_AttributeGroup_new");
977  RNA_def_function_ui_description(func, "Add attribute to geometry");
979  parm = RNA_def_string(func, "name", "Attribute", 0, "Name", "Name of geometry attribute");
981 
982  parm = RNA_def_enum(
983  func, "type", rna_enum_attribute_type_items, CD_PROP_FLOAT, "Type", "Attribute type");
985 
986  parm = RNA_def_enum(func,
987  "domain",
990  "Domain",
991  "Type of element that attribute is stored on");
993 
994  parm = RNA_def_pointer(func, "attribute", "Attribute", "", "New geometry attribute");
996  RNA_def_function_return(func, parm);
997 
998  func = RNA_def_function(srna, "remove", "rna_AttributeGroup_remove");
999  RNA_def_function_ui_description(func, "Remove attribute from geometry");
1001  parm = RNA_def_pointer(func, "attribute", "Attribute", "", "Geometry Attribute");
1004 
1005  /* Active */
1006  prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
1007  RNA_def_property_struct_type(prop, "Attribute");
1008  RNA_def_property_ui_text(prop, "Active Attribute", "Active attribute");
1010  prop, "rna_AttributeGroup_active_get", "rna_AttributeGroup_active_set", NULL, NULL);
1012  RNA_def_property_update(prop, 0, "rna_AttributeGroup_update_active");
1013 
1014  prop = RNA_def_property(srna, "active_index", PROP_INT, PROP_NONE);
1015  RNA_def_property_ui_text(prop, "Active Attribute Index", "Active attribute index");
1018  "rna_AttributeGroup_active_index_get",
1019  "rna_AttributeGroup_active_index_set",
1020  "rna_AttributeGroup_active_index_range");
1021  RNA_def_property_update(prop, 0, "rna_AttributeGroup_update_active");
1022 
1023  prop = RNA_def_property(srna, "active_color", PROP_POINTER, PROP_NONE);
1024  RNA_def_property_struct_type(prop, "Attribute");
1025  RNA_def_property_ui_text(prop, "Active Color", "Active color attribute for display and editing");
1027  "rna_AttributeGroup_active_color_get",
1028  "rna_AttributeGroup_active_color_set",
1029  NULL,
1030  NULL);
1032  RNA_def_property_update(prop, 0, "rna_AttributeGroup_update_active_color");
1033 
1034  prop = RNA_def_property(srna, "active_color_index", PROP_INT, PROP_NONE);
1035  RNA_def_property_ui_text(prop, "Active Color Index", "Active color attribute index");
1038  "rna_AttributeGroup_active_color_index_get",
1039  "rna_AttributeGroup_active_color_index_set",
1040  "rna_AttributeGroup_active_color_index_range");
1041  RNA_def_property_update(prop, 0, "rna_AttributeGroup_update_active_color");
1042 
1043  prop = RNA_def_property(srna, "render_color_index", PROP_INT, PROP_NONE);
1045  "Active Render Color Index",
1046  "The index of the color attribute used as a fallback for rendering");
1049  "rna_AttributeGroup_render_color_index_get",
1050  "rna_AttributeGroup_render_color_index_set",
1051  "rna_AttributeGroup_render_color_index_range");
1052  RNA_def_property_update(prop, 0, "rna_AttributeGroup_update_active_color");
1053 }
1054 
1056 {
1057  PropertyRNA *prop;
1058 
1059  /* Attributes */
1060  prop = RNA_def_property(srna, "attributes", PROP_COLLECTION, PROP_NONE);
1062  "rna_AttributeGroup_iterator_begin",
1063  "rna_AttributeGroup_iterator_next",
1064  "rna_iterator_array_end",
1065  "rna_AttributeGroup_iterator_get",
1066  "rna_AttributeGroup_length",
1067  NULL,
1068  NULL,
1069  NULL);
1070  RNA_def_property_struct_type(prop, "Attribute");
1071  RNA_def_property_ui_text(prop, "Attributes", "Geometry attributes");
1072  RNA_def_property_srna(prop, "AttributeGroup");
1073 
1074  prop = RNA_def_property(srna, "color_attributes", PROP_COLLECTION, PROP_NONE);
1076  "rna_AttributeGroup_color_iterator_begin",
1077  "rna_AttributeGroup_color_iterator_next",
1078  "rna_iterator_array_end",
1079  "rna_AttributeGroup_color_iterator_get",
1080  "rna_AttributeGroup_color_length",
1081  NULL,
1082  NULL,
1083  NULL);
1084  RNA_def_property_struct_type(prop, "Attribute");
1085  RNA_def_property_ui_text(prop, "Color Attributes", "Geometry color attributes");
1086  RNA_def_property_srna(prop, "AttributeGroup");
1087 }
1088 
1090 {
1091  rna_def_attribute(brna);
1093 }
1094 #endif
Generic geometry attributes built on CustomData.
int BKE_id_attributes_length(const struct ID *id, eAttrDomainMask domain_mask, eCustomDataMask mask)
void BKE_id_attributes_active_color_set(struct ID *id, struct CustomDataLayer *active_layer)
Definition: attribute.cc:715
int BKE_id_attribute_data_length(struct ID *id, struct CustomDataLayer *layer)
Definition: attribute.cc:413
eAttrDomain
Definition: BKE_attribute.h:25
@ ATTR_DOMAIN_CURVE
Definition: BKE_attribute.h:31
@ ATTR_DOMAIN_INSTANCE
Definition: BKE_attribute.h:32
@ ATTR_DOMAIN_POINT
Definition: BKE_attribute.h:27
@ ATTR_DOMAIN_FACE
Definition: BKE_attribute.h:29
@ ATTR_DOMAIN_CORNER
Definition: BKE_attribute.h:30
@ ATTR_DOMAIN_AUTO
Definition: BKE_attribute.h:26
@ ATTR_DOMAIN_EDGE
Definition: BKE_attribute.h:28
bool BKE_id_attribute_remove(struct ID *id, const char *name, struct ReportList *reports)
Definition: attribute.cc:288
struct CustomDataLayer * BKE_id_attributes_active_get(struct ID *id)
Definition: attribute.cc:458
int * BKE_id_attributes_active_index_p(struct ID *id)
Definition: attribute.cc:512
void BKE_id_attributes_render_color_set(struct ID *id, struct CustomDataLayer *active_layer)
Definition: attribute.cc:727
struct CustomDataLayer * BKE_id_attributes_active_color_get(const struct ID *id)
struct CustomDataLayer * BKE_id_attribute_new(struct ID *id, const char *name, int type, eAttrDomain domain, struct ReportList *reports)
Definition: attribute.cc:220
bool BKE_attribute_allow_procedural_access(const char *attribute_name)
Definition: attribute.cc:138
@ ATTR_DOMAIN_MASK_POINT
Definition: BKE_attribute.h:37
@ ATTR_DOMAIN_MASK_ALL
Definition: BKE_attribute.h:42
@ ATTR_DOMAIN_MASK_CORNER
Definition: BKE_attribute.h:40
void BKE_id_attributes_active_set(struct ID *id, struct CustomDataLayer *layer)
Definition: attribute.cc:488
int BKE_id_attribute_to_index(const struct ID *id, const CustomDataLayer *layer, eAttrDomainMask domain_mask, eCustomDataMask layer_mask)
struct CustomDataLayer * BKE_id_attributes_render_color_get(const struct ID *id)
CustomDataLayer * BKE_id_attribute_from_index(struct ID *id, int lookup_index, eAttrDomainMask domain_mask, eCustomDataMask layer_mask)
Definition: attribute.cc:551
eAttrDomain BKE_id_attribute_domain(const struct ID *id, const struct CustomDataLayer *layer)
bool BKE_id_attribute_rename(struct ID *id, const char *old_name, const char *new_name, struct ReportList *reports)
Definition: attribute.cc:143
#define ATTR_DOMAIN_MASK_COLOR
Definition: BKE_attribute.h:48
bool BKE_id_attribute_required(const struct ID *id, const char *name)
CustomData * BKE_id_attributes_iterator_next_domain(struct ID *id, struct CustomDataLayer *layers)
Definition: attribute.cc:529
CustomData interface, see also DNA_customdata_types.h.
#define CD_TYPE_AS_MASK(_type)
MINLINE void srgb_to_linearrgb_uchar4(float linear[4], const unsigned char srgb[4])
MINLINE void linearrgb_to_srgb_uchar4(unsigned char srgb[4], const float linear[4])
size_t size_t char * BLI_sprintfN(const char *__restrict format,...) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_MALLOC ATTR_PRINTF_FORMAT(1
#define UNUSED(x)
#define ELEM(...)
void DEG_id_tag_update(struct ID *id, int flag)
@ ID_RECALC_GEOMETRY
Definition: DNA_ID.h:791
ID_Type
Definition: DNA_ID_enums.h:44
@ ID_CV
Definition: DNA_ID_enums.h:81
@ ID_ME
Definition: DNA_ID_enums.h:48
@ ID_PT
Definition: DNA_ID_enums.h:82
#define CD_MASK_PROP_BYTE_COLOR
#define CD_MASK_PROP_COLOR
@ CD_FLAG_TEMPORARY
#define CD_MASK_PROP_ALL
#define CD_MASK_COLOR_ALL
eCustomDataType
@ CD_PROP_BYTE_COLOR
@ CD_PROP_FLOAT
@ CD_PROP_FLOAT3
@ CD_PROP_COLOR
@ CD_PROP_INT8
@ CD_PROP_INT32
@ CD_PROP_FLOAT2
@ CD_PROP_BOOL
@ CD_PROP_STRING
@ CD_AUTO_FROM_NAME
struct MBoolProperty MBoolProperty
struct MStringProperty MStringProperty
struct MIntProperty MIntProperty
struct MLoopCol MLoopCol
struct MFloatProperty MFloatProperty
struct MPropCol MPropCol
_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
#define RNA_POINTER_INVALIDATE(ptr)
Definition: RNA_access.h:744
const EnumPropertyItem * rna_enum_attribute_domain_itemf(struct ID *id, bool include_instances, bool *r_free)
@ PARM_RNAPTR
Definition: RNA_types.h:354
@ PARM_REQUIRED
Definition: RNA_types.h:352
@ FUNC_USE_REPORTS
Definition: RNA_types.h:663
@ PROP_FLOAT
Definition: RNA_types.h:61
@ PROP_BOOLEAN
Definition: RNA_types.h:59
@ PROP_ENUM
Definition: RNA_types.h:63
@ PROP_INT
Definition: RNA_types.h:60
@ PROP_STRING
Definition: RNA_types.h:62
@ PROP_POINTER
Definition: RNA_types.h:64
@ PROP_COLLECTION
Definition: RNA_types.h:65
@ PROP_THICK_WRAP
Definition: RNA_types.h:285
@ PROP_ANIMATABLE
Definition: RNA_types.h:202
@ PROP_NEVER_UNLINK
Definition: RNA_types.h:246
@ PROP_EDITABLE
Definition: RNA_types.h:189
@ PROP_NEVER_NULL
Definition: RNA_types.h:239
@ PROP_DIRECTION
Definition: RNA_types.h:155
@ PROP_COLOR
Definition: RNA_types.h:153
@ PROP_NONE
Definition: RNA_types.h:126
#define C
Definition: RandGen.cpp:25
#define NC_GEOM
Definition: WM_types.h:343
#define ND_DATA
Definition: WM_types.h:456
return(oflags[bm->toolflag_index].f &oflag) !=0
Scene scene
#define GS(x)
Definition: iris.c:225
static unsigned a[3]
Definition: RandGen.cpp:78
T length(const vec_base< T, Size > &a)
void RNA_pointer_create(ID *id, StructRNA *type, void *data, PointerRNA *r_ptr)
Definition: rna_access.c:136
const PointerRNA PointerRNA_NULL
Definition: rna_access.c:61
void rna_iterator_array_begin(CollectionPropertyIterator *iter, void *ptr, int itemsize, int length, bool free_ptr, IteratorSkipFunc skip)
Definition: rna_access.c:4781
void * rna_iterator_array_get(CollectionPropertyIterator *iter)
Definition: rna_access.c:4829
PointerRNA rna_pointer_inherit_refine(PointerRNA *ptr, StructRNA *type, void *data)
Definition: rna_access.c:186
void rna_iterator_array_next(CollectionPropertyIterator *iter)
Definition: rna_access.c:4813
static void rna_def_attribute_int8(BlenderRNA *brna)
const EnumPropertyItem rna_enum_color_attribute_domain_items[]
static void rna_def_attribute_bool(BlenderRNA *brna)
static void rna_def_attribute(BlenderRNA *brna)
const EnumPropertyItem rna_enum_attribute_domain_with_auto_items[]
Definition: rna_attribute.c:93
const EnumPropertyItem rna_enum_attribute_curves_domain_items[]
void rna_def_attributes_common(StructRNA *srna)
static void rna_def_attribute_float_vector(BlenderRNA *brna)
static void rna_def_attribute_float_color(BlenderRNA *brna)
static void rna_def_attribute_float(BlenderRNA *brna)
static void rna_def_attribute_group(BlenderRNA *brna)
const EnumPropertyItem rna_enum_attribute_domain_items[]
Definition: rna_attribute.c:70
static void rna_def_attribute_int(BlenderRNA *brna)
static void rna_def_attribute_byte_color(BlenderRNA *brna)
void RNA_def_attribute(BlenderRNA *brna)
static void rna_def_attribute_float2(BlenderRNA *brna)
const EnumPropertyItem rna_enum_attribute_domain_without_corner_items[]
Definition: rna_attribute.c:84
const EnumPropertyItem rna_enum_attribute_type_items[]
Definition: rna_attribute.c:26
const EnumPropertyItem rna_enum_attribute_type_with_auto_items[]
Definition: rna_attribute.c:52
const EnumPropertyItem rna_enum_color_attribute_type_items[]
Definition: rna_attribute.c:43
static void rna_def_attribute_string(BlenderRNA *brna)
void RNA_def_struct_refine_func(StructRNA *srna, const char *refine)
Definition: rna_define.c:1148
void RNA_def_struct_path_func(StructRNA *srna, const char *path)
Definition: rna_define.c:1193
PropertyRNA * RNA_def_pointer(StructOrFunctionRNA *cont_, const char *identifier, const char *type, const char *ui_name, const char *ui_description)
Definition: rna_define.c:4170
void RNA_def_property_boolean_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t bit)
Definition: rna_define.c:2236
void RNA_def_parameter_clear_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
Definition: rna_define.c:1526
void RNA_def_property_string_funcs(PropertyRNA *prop, const char *get, const char *length, const char *set)
Definition: rna_define.c:3285
void RNA_def_function_return(FunctionRNA *func, PropertyRNA *ret)
Definition: rna_define.c:4312
void RNA_def_property_float_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
Definition: rna_define.c:3126
void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description)
Definition: rna_define.c:1645
void RNA_def_property_string_sdna(PropertyRNA *prop, const char *structname, const char *propname)
Definition: rna_define.c:2695
FunctionRNA * RNA_def_function(StructRNA *srna, const char *identifier, const char *call)
Definition: rna_define.c:4273
void RNA_def_property_srna(PropertyRNA *prop, const char *type)
Definition: rna_define.c:3474
void RNA_def_property_collection_funcs(PropertyRNA *prop, const char *begin, const char *next, const char *end, const char *get, const char *length, const char *lookupint, const char *lookupstring, const char *assignint)
Definition: rna_define.c:3420
void RNA_def_struct_ui_text(StructRNA *srna, const char *name, const char *description)
Definition: rna_define.c:1237
void RNA_def_property_boolean_funcs(PropertyRNA *prop, const char *get, const char *set)
Definition: rna_define.c:2944
void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item)
Definition: rna_define.c:1872
void RNA_def_struct_sdna(StructRNA *srna, const char *structname)
Definition: rna_define.c:1048
void RNA_def_property_array(PropertyRNA *prop, int length)
Definition: rna_define.c:1539
void RNA_def_property_range(PropertyRNA *prop, double min, double max)
Definition: rna_define.c:1737
void RNA_def_property_struct_type(PropertyRNA *prop, const char *type)
Definition: rna_define.c:1772
void RNA_def_function_ui_description(FunctionRNA *func, const char *description)
Definition: rna_define.c:4347
void RNA_def_property_update(PropertyRNA *prop, int noteflag, const char *func)
Definition: rna_define.c:2900
void RNA_def_property_enum_funcs(PropertyRNA *prop, const char *get, const char *set, const char *item)
Definition: rna_define.c:3224
void RNA_def_property_editable_func(PropertyRNA *prop, const char *editable)
Definition: rna_define.c:2855
PropertyRNA * RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier, int type, int subtype)
Definition: rna_define.c:1257
void RNA_enum_item_end(EnumPropertyItem **items, int *totitem)
Definition: rna_define.c:4487
void RNA_def_struct_name_property(struct StructRNA *srna, struct PropertyRNA *prop)
Definition: rna_define.c:1103
void RNA_def_function_flag(FunctionRNA *func, int flag)
Definition: rna_define.c:4342
void RNA_def_property_clear_flag(PropertyRNA *prop, PropertyFlag flag)
Definition: rna_define.c:1495
void RNA_def_property_pointer_funcs(PropertyRNA *prop, const char *get, const char *set, const char *type_fn, const char *poll)
Definition: rna_define.c:3385
StructRNA * RNA_def_struct(BlenderRNA *brna, const char *identifier, const char *from)
Definition: rna_define.c:1028
void RNA_def_property_enum_sdna(PropertyRNA *prop, const char *structname, const char *propname)
Definition: rna_define.c:2601
void RNA_enum_item_add(EnumPropertyItem **items, int *totitem, const EnumPropertyItem *item)
Definition: rna_define.c:4436
void RNA_def_property_int_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
Definition: rna_define.c:3028
PropertyRNA * RNA_def_string(StructOrFunctionRNA *cont_, const char *identifier, const char *default_value, int maxlen, const char *ui_name, const char *ui_description)
Definition: rna_define.c:3687
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
Definition: rna_define.c:1490
void RNA_def_property_float_sdna(PropertyRNA *prop, const char *structname, const char *propname)
Definition: rna_define.c:2493
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, int default_value, const char *ui_name, const char *ui_description)
Definition: rna_define.c:3783
void RNA_def_property_int_sdna(PropertyRNA *prop, const char *structname, const char *propname)
Definition: rna_define.c:2343
void RNA_def_parameter_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
Definition: rna_define.c:1518
void rna_AttributeGroup_iterator_next(CollectionPropertyIterator *iter)
void rna_AttributeGroup_color_iterator_next(CollectionPropertyIterator *iter)
int rna_AttributeGroup_length(PointerRNA *ptr)
int rna_AttributeGroup_color_length(PointerRNA *ptr)
PointerRNA rna_AttributeGroup_color_iterator_get(CollectionPropertyIterator *iter)
void rna_AttributeGroup_iterator_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
void rna_AttributeGroup_color_iterator_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
PointerRNA rna_AttributeGroup_iterator_get(CollectionPropertyIterator *iter)
#define min(a, b)
Definition: sort.c:35
#define INT8_MIN
Definition: stdint.h:132
#define INT8_MAX
Definition: stdint.h:133
signed char int8_t
Definition: stdint.h:75
char * endptr
Definition: RNA_types.h:378
union CollectionPropertyIterator::@1147 internal
CustomDataLayer * layers
const char * identifier
Definition: RNA_types.h:461
Definition: DNA_ID.h:368
int us
Definition: DNA_ID.h:388
char name[66]
Definition: DNA_ID.h:378
unsigned char r
Definition: BKE_main.h:121
void * data
Definition: RNA_types.h:38
struct ID * owner_id
Definition: RNA_types.h:36
float max
#define N_(msgid)
void WM_main_add_notifier(unsigned int type, void *reference)
PointerRNA * ptr
Definition: wm_files.c:3480