Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_attribute.c
| Show First 20 Lines • Show All 163 Lines • ▼ Show 20 Lines | case CD_PROP_COLOR: | ||||
| struct_size = sizeof(MPropCol); | struct_size = sizeof(MPropCol); | ||||
| break; | break; | ||||
| case CD_MLOOPCOL: | case CD_MLOOPCOL: | ||||
| struct_size = sizeof(MLoopCol); | struct_size = sizeof(MLoopCol); | ||||
| break; | break; | ||||
| case CD_PROP_STRING: | case CD_PROP_STRING: | ||||
| struct_size = sizeof(MStringProperty); | struct_size = sizeof(MStringProperty); | ||||
| break; | break; | ||||
| case CD_PROP_BOOL: | |||||
| struct_size = sizeof(MBoolProperty); | |||||
| break; | |||||
| default: | default: | ||||
| struct_size = 0; | struct_size = 0; | ||||
| length = 0; | length = 0; | ||||
| break; | break; | ||||
| } | } | ||||
| rna_iterator_array_begin(iter, layer->data, struct_size, length, 0, NULL); | rna_iterator_array_begin(iter, layer->data, struct_size, length, 0, NULL); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 114 Lines • ▼ Show 20 Lines | case CD_PROP_COLOR: | ||||
| type = &RNA_FloatColorAttribute; | type = &RNA_FloatColorAttribute; | ||||
| break; | break; | ||||
| case CD_MLOOPCOL: | case CD_MLOOPCOL: | ||||
| type = &RNA_ByteColorAttribute; | type = &RNA_ByteColorAttribute; | ||||
| break; | break; | ||||
| case CD_PROP_STRING: | case CD_PROP_STRING: | ||||
| type = &RNA_StringAttribute; | type = &RNA_StringAttribute; | ||||
| break; | break; | ||||
| case CD_PROP_BOOL: | |||||
| type = &RNA_BoolAttribute; | |||||
| break; | |||||
| default: | default: | ||||
| return PointerRNA_NULL; | return PointerRNA_NULL; | ||||
| } | } | ||||
| return rna_pointer_inherit_refine(&iter->parent, type, layer); | return rna_pointer_inherit_refine(&iter->parent, type, layer); | ||||
| } | } | ||||
| int rna_AttributeGroup_length(PointerRNA *ptr) | int rna_AttributeGroup_length(PointerRNA *ptr) | ||||
| ▲ Show 20 Lines • Show All 240 Lines • ▼ Show 20 Lines | static void rna_def_attribute_string(BlenderRNA *brna) | ||||
| srna = RNA_def_struct(brna, "StringAttributeValue", NULL); | srna = RNA_def_struct(brna, "StringAttributeValue", NULL); | ||||
| RNA_def_struct_sdna(srna, "MStringProperty"); | RNA_def_struct_sdna(srna, "MStringProperty"); | ||||
| RNA_def_struct_ui_text(srna, "String Attribute Value", "String value in geometry attribute"); | RNA_def_struct_ui_text(srna, "String Attribute Value", "String value in geometry attribute"); | ||||
| prop = RNA_def_property(srna, "value", PROP_STRING, PROP_NONE); | prop = RNA_def_property(srna, "value", PROP_STRING, PROP_NONE); | ||||
| RNA_def_property_string_sdna(prop, NULL, "s"); | RNA_def_property_string_sdna(prop, NULL, "s"); | ||||
| RNA_def_property_update(prop, 0, "rna_Attribute_update_data"); | RNA_def_property_update(prop, 0, "rna_Attribute_update_data"); | ||||
| } | } | ||||
| static void rna_def_attribute_bool(BlenderRNA *brna) | |||||
| { | |||||
| StructRNA *srna; | |||||
| PropertyRNA *prop; | |||||
| srna = RNA_def_struct(brna, "BoolAttribute", "Attribute"); | |||||
| RNA_def_struct_sdna(srna, "CustomDataLayer"); | |||||
| RNA_def_struct_ui_text(srna, "Bool Attribute", "Bool geometry attribute"); | |||||
| prop = RNA_def_property(srna, "data", PROP_COLLECTION, PROP_NONE); | |||||
| RNA_def_property_struct_type(prop, "BoolAttributeValue"); | |||||
| RNA_def_property_collection_funcs(prop, | |||||
| "rna_Attribute_data_begin", | |||||
| "rna_iterator_array_next", | |||||
| "rna_iterator_array_end", | |||||
| "rna_iterator_array_get", | |||||
| "rna_Attribute_data_length", | |||||
| NULL, | |||||
| NULL, | |||||
| NULL); | |||||
| srna = RNA_def_struct(brna, "BoolAttributeValue", NULL); | |||||
| RNA_def_struct_sdna(srna, "MBoolProperty"); | |||||
| RNA_def_struct_ui_text(srna, "Bool Attribute Value", "Bool value in geometry attribute"); | |||||
| prop = RNA_def_property(srna, "value", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "b", 0x01); | |||||
| } | |||||
| static void rna_def_attribute(BlenderRNA *brna) | static void rna_def_attribute(BlenderRNA *brna) | ||||
| { | { | ||||
| PropertyRNA *prop; | PropertyRNA *prop; | ||||
| StructRNA *srna; | StructRNA *srna; | ||||
| srna = RNA_def_struct(brna, "Attribute", NULL); | srna = RNA_def_struct(brna, "Attribute", NULL); | ||||
| RNA_def_struct_sdna(srna, "CustomDataLayer"); | RNA_def_struct_sdna(srna, "CustomDataLayer"); | ||||
| RNA_def_struct_ui_text(srna, "Attribute", "Geometry attribute"); | RNA_def_struct_ui_text(srna, "Attribute", "Geometry attribute"); | ||||
| Show All 21 Lines | static void rna_def_attribute(BlenderRNA *brna) | ||||
| /* types */ | /* types */ | ||||
| rna_def_attribute_float(brna); | rna_def_attribute_float(brna); | ||||
| rna_def_attribute_float_vector(brna); | rna_def_attribute_float_vector(brna); | ||||
| rna_def_attribute_float_color(brna); | rna_def_attribute_float_color(brna); | ||||
| rna_def_attribute_byte_color(brna); | rna_def_attribute_byte_color(brna); | ||||
| rna_def_attribute_int(brna); | rna_def_attribute_int(brna); | ||||
| rna_def_attribute_string(brna); | rna_def_attribute_string(brna); | ||||
| rna_def_attribute_bool(brna); | |||||
| } | } | ||||
| /* Mesh/PointCloud/Hair.attributes */ | /* Mesh/PointCloud/Hair.attributes */ | ||||
| static void rna_def_attribute_group(BlenderRNA *brna) | static void rna_def_attribute_group(BlenderRNA *brna) | ||||
| { | { | ||||
| StructRNA *srna; | StructRNA *srna; | ||||
| PropertyRNA *prop; | PropertyRNA *prop; | ||||
| FunctionRNA *func; | FunctionRNA *func; | ||||
| ▲ Show 20 Lines • Show All 77 Lines • Show Last 20 Lines | |||||