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"},
35 "RGBA color with 8-bit positive integer values"},
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"},
44 {
CD_PROP_COLOR,
"FLOAT_COLOR", 0,
"Color",
"RGBA color 32-bit floating-point values"},
49 "RGBA color with 8-bit positive integer values"},
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"},
62 "RGBA color with 8-bit positive integer values"},
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"},
136 return &RNA_FloatAttribute;
138 return &RNA_IntAttribute;
140 return &RNA_FloatVectorAttribute;
142 return &RNA_FloatColorAttribute;
144 return &RNA_ByteColorAttribute;
146 return &RNA_StringAttribute;
148 return &RNA_BoolAttribute;
150 return &RNA_Float2Attribute;
152 return &RNA_ByteIntAttribute;
161 return srna_by_custom_data_layer_type(layer->
type);
164 static void rna_Attribute_name_set(
PointerRNA *
ptr,
const char *value)
170 static int rna_Attribute_name_editable(
PointerRNA *
ptr,
const char **r_info)
174 *r_info =
N_(
"Cannot modify name of required geometry attribute");
188 bool include_instances,
255 switch (layer->
type) {
263 struct_size =
sizeof(
float[3]);
278 struct_size =
sizeof(
float[2]);
281 struct_size =
sizeof(
int8_t);
312 static void rna_ByteColorAttributeValue_color_get(
PointerRNA *
ptr,
float *values)
318 static void rna_ByteColorAttributeValue_color_set(
PointerRNA *
ptr,
const float *values)
332 static void rna_ByteIntAttributeValue_set(
PointerRNA *
ptr,
const int new_value)
342 *value = (
int8_t)new_value;
349 ID *
id,
ReportList *reports,
const char *name,
const int type,
const int domain)
392 static void rna_AttributeGroup_next_domain(
ID *
id,
402 if (customdata ==
NULL) {
407 }
while (!iter->
valid);
413 rna_AttributeGroup_next_domain(
ptr->
owner_id, iter, rna_Attributes_layer_skip);
422 rna_AttributeGroup_next_domain(
id, iter, rna_Attributes_layer_skip);
440 rna_AttributeGroup_next_domain(
ptr->
owner_id, iter, rna_Attributes_noncolor_layer_skip);
449 rna_AttributeGroup_next_domain(
id, iter, rna_Attributes_noncolor_layer_skip);
476 static int rna_AttributeGroup_active_index_get(
PointerRNA *
ptr)
488 return attribute_ptr;
500 static void rna_AttributeGroup_active_index_set(
PointerRNA *
ptr,
int value)
505 static void rna_AttributeGroup_active_index_range(
517 rna_Attribute_update_data(bmain,
scene,
ptr);
527 return attribute_ptr;
530 static void rna_AttributeGroup_active_color_set(
PointerRNA *
ptr,
540 static int rna_AttributeGroup_active_color_index_get(
PointerRNA *
ptr)
548 static void rna_AttributeGroup_active_color_index_set(
PointerRNA *
ptr,
int value)
554 fprintf(stderr,
"%s: error setting active color index to %d\n", __func__, value);
561 static void rna_AttributeGroup_active_color_index_range(
571 static void rna_AttributeGroup_update_active_color(
Main *
UNUSED(bmain),
584 static int rna_AttributeGroup_render_color_index_get(
PointerRNA *
ptr)
592 static void rna_AttributeGroup_render_color_index_set(
PointerRNA *
ptr,
int value)
598 fprintf(stderr,
"%s: error setting render color index to %d\n", __func__, value);
605 static void rna_AttributeGroup_render_color_index_range(
624 srna,
"Float Attribute",
"Geometry attribute that stores floating-point values");
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",
641 srna,
"Float Attribute Value",
"Floating-point value in geometry attribute");
656 srna,
"Float Vector Attribute",
"Geometry attribute that stores floating-point 3D vectors");
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",
674 srna,
"Float Vector Attribute Value",
"Vector value in geometry attribute");
692 "Float Color Attribute",
693 "Geometry attribute that stores RGBA colors as floating-point values "
694 "using 32-bits per channel");
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",
729 "Byte Color Attribute",
730 "Geometry attribute that stores RGBA colors as positive integer values "
731 "using 8-bits per channel");
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",
754 "rna_ByteColorAttributeValue_color_get",
755 "rna_ByteColorAttributeValue_color_set",
769 srna,
"Integer Attribute",
"Geometry attribute that stores integer values");
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",
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",
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",
856 srna,
"8-bit Integer Attribute",
"Geometry attribute that stores 8-bit integers");
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",
873 srna,
"8-bit Integer Attribute Value",
"8-bit value in geometry attribute");
876 prop,
"rna_ByteIntAttributeValue_get",
"rna_ByteIntAttributeValue_set",
NULL);
888 srna,
"Float2 Attribute",
"Geometry attribute that stores floating-point 2D vectors");
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",
941 prop,
"rna_Attribute_domain_get",
NULL,
"rna_Attribute_domain_itemf");
948 prop,
"Is Internal",
"The attribute is meant for internal use by Blender");
979 parm =
RNA_def_string(func,
"name",
"Attribute", 0,
"Name",
"Name of geometry attribute");
991 "Type of element that attribute is stored on");
994 parm =
RNA_def_pointer(func,
"attribute",
"Attribute",
"",
"New geometry attribute");
1001 parm =
RNA_def_pointer(func,
"attribute",
"Attribute",
"",
"Geometry Attribute");
1010 prop,
"rna_AttributeGroup_active_get",
"rna_AttributeGroup_active_set",
NULL,
NULL);
1018 "rna_AttributeGroup_active_index_get",
1019 "rna_AttributeGroup_active_index_set",
1020 "rna_AttributeGroup_active_index_range");
1027 "rna_AttributeGroup_active_color_get",
1028 "rna_AttributeGroup_active_color_set",
1038 "rna_AttributeGroup_active_color_index_get",
1039 "rna_AttributeGroup_active_color_index_set",
1040 "rna_AttributeGroup_active_color_index_range");
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");
1062 "rna_AttributeGroup_iterator_begin",
1063 "rna_AttributeGroup_iterator_next",
1064 "rna_iterator_array_end",
1065 "rna_AttributeGroup_iterator_get",
1066 "rna_AttributeGroup_length",
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",
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)
int BKE_id_attribute_data_length(struct ID *id, struct CustomDataLayer *layer)
bool BKE_id_attribute_remove(struct ID *id, const char *name, struct ReportList *reports)
struct CustomDataLayer * BKE_id_attributes_active_get(struct ID *id)
int * BKE_id_attributes_active_index_p(struct ID *id)
void BKE_id_attributes_render_color_set(struct ID *id, struct CustomDataLayer *active_layer)
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)
bool BKE_attribute_allow_procedural_access(const char *attribute_name)
@ ATTR_DOMAIN_MASK_CORNER
void BKE_id_attributes_active_set(struct ID *id, struct CustomDataLayer *layer)
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)
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)
#define ATTR_DOMAIN_MASK_COLOR
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)
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
void DEG_id_tag_update(struct ID *id, int flag)
#define CD_MASK_PROP_BYTE_COLOR
#define CD_MASK_PROP_COLOR
#define CD_MASK_COLOR_ALL
struct MBoolProperty MBoolProperty
struct MStringProperty MStringProperty
struct MIntProperty MIntProperty
struct MFloatProperty MFloatProperty
_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)
const EnumPropertyItem * rna_enum_attribute_domain_itemf(struct ID *id, bool include_instances, bool *r_free)
return(oflags[bm->toolflag_index].f &oflag) !=0
T length(const vec_base< T, Size > &a)
void RNA_pointer_create(ID *id, StructRNA *type, void *data, PointerRNA *r_ptr)
const PointerRNA PointerRNA_NULL
void rna_iterator_array_begin(CollectionPropertyIterator *iter, void *ptr, int itemsize, int length, bool free_ptr, IteratorSkipFunc skip)
void * rna_iterator_array_get(CollectionPropertyIterator *iter)
PointerRNA rna_pointer_inherit_refine(PointerRNA *ptr, StructRNA *type, void *data)
void rna_iterator_array_next(CollectionPropertyIterator *iter)
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[]
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[]
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[]
const EnumPropertyItem rna_enum_attribute_type_items[]
const EnumPropertyItem rna_enum_attribute_type_with_auto_items[]
const EnumPropertyItem rna_enum_color_attribute_type_items[]
static void rna_def_attribute_string(BlenderRNA *brna)
void RNA_def_struct_refine_func(StructRNA *srna, const char *refine)
void RNA_def_struct_path_func(StructRNA *srna, const char *path)
PropertyRNA * RNA_def_pointer(StructOrFunctionRNA *cont_, const char *identifier, const char *type, const char *ui_name, const char *ui_description)
void RNA_def_property_boolean_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t bit)
void RNA_def_parameter_clear_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
void RNA_def_property_string_funcs(PropertyRNA *prop, const char *get, const char *length, const char *set)
void RNA_def_function_return(FunctionRNA *func, PropertyRNA *ret)
void RNA_def_property_float_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description)
void RNA_def_property_string_sdna(PropertyRNA *prop, const char *structname, const char *propname)
FunctionRNA * RNA_def_function(StructRNA *srna, const char *identifier, const char *call)
void RNA_def_property_srna(PropertyRNA *prop, const char *type)
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)
void RNA_def_struct_ui_text(StructRNA *srna, const char *name, const char *description)
void RNA_def_property_boolean_funcs(PropertyRNA *prop, const char *get, const char *set)
void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item)
void RNA_def_struct_sdna(StructRNA *srna, const char *structname)
void RNA_def_property_array(PropertyRNA *prop, int length)
void RNA_def_property_range(PropertyRNA *prop, double min, double max)
void RNA_def_property_struct_type(PropertyRNA *prop, const char *type)
void RNA_def_function_ui_description(FunctionRNA *func, const char *description)
void RNA_def_property_update(PropertyRNA *prop, int noteflag, const char *func)
void RNA_def_property_enum_funcs(PropertyRNA *prop, const char *get, const char *set, const char *item)
void RNA_def_property_editable_func(PropertyRNA *prop, const char *editable)
PropertyRNA * RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier, int type, int subtype)
void RNA_enum_item_end(EnumPropertyItem **items, int *totitem)
void RNA_def_struct_name_property(struct StructRNA *srna, struct PropertyRNA *prop)
void RNA_def_function_flag(FunctionRNA *func, int flag)
void RNA_def_property_clear_flag(PropertyRNA *prop, PropertyFlag flag)
void RNA_def_property_pointer_funcs(PropertyRNA *prop, const char *get, const char *set, const char *type_fn, const char *poll)
StructRNA * RNA_def_struct(BlenderRNA *brna, const char *identifier, const char *from)
void RNA_def_property_enum_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_enum_item_add(EnumPropertyItem **items, int *totitem, const EnumPropertyItem *item)
void RNA_def_property_int_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
PropertyRNA * RNA_def_string(StructOrFunctionRNA *cont_, const char *identifier, const char *default_value, int maxlen, const char *ui_name, const char *ui_description)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
void RNA_def_property_float_sdna(PropertyRNA *prop, const char *structname, const char *propname)
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, int default_value, const char *ui_name, const char *ui_description)
void RNA_def_property_int_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_parameter_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
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)
union CollectionPropertyIterator::@1147 internal
void WM_main_add_notifier(unsigned int type, void *reference)