diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-02-16 02:43:51 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-02-16 02:43:51 +0300 |
commit | d8ce09ce53cf90fcd077cc6b6343e3ca860fe033 (patch) | |
tree | e731bf63a5688a72ddf5c17256ac1c80a051d7b9 /source/blender/makesrna/intern/rna_rna.c | |
parent | 80bb824929775658bb937665318ae6981642dd6f (diff) |
bugfix [#21173] Autocompleate raises an error
split PropertyRNA off into 3 types, base type, collection and array, since array and collections needed internal checks inside almost every function its better to have the, as subclassed to the property type. This makes introspection more useful.
Also made printing of structs and properties prettier giveing type and length.
Diffstat (limited to 'source/blender/makesrna/intern/rna_rna.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_rna.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/source/blender/makesrna/intern/rna_rna.c b/source/blender/makesrna/intern/rna_rna.c index f8e6720fe92..7c4b48b09f6 100644 --- a/source/blender/makesrna/intern/rna_rna.c +++ b/source/blender/makesrna/intern/rna_rna.c @@ -32,6 +32,16 @@ #include "rna_internal.h" +EnumPropertyItem property_type_items[] = { + {PROP_BOOLEAN, "BOOLEAN", 0, "Boolean", ""}, + {PROP_INT, "INT", 0, "Integer", ""}, + {PROP_FLOAT, "FLOAT", 0, "Float", ""}, + {PROP_STRING, "STRING", 0, "String", ""}, + {PROP_ENUM, "ENUM", 0, "Enumeration", ""}, + {PROP_POINTER, "POINTER", 0, "Pointer", ""}, + {PROP_COLLECTION, "COLLECTION", 0, "Collection", ""}, + {0, NULL, 0, NULL, NULL}}; + EnumPropertyItem property_unit_items[] = { {PROP_UNIT_NONE, "NONE", 0, "None", ""}, {PROP_UNIT_LENGTH, "LENGTH", 0, "Length", ""}, @@ -907,15 +917,6 @@ static void rna_def_property(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - static EnumPropertyItem type_items[] = { - {PROP_BOOLEAN, "BOOLEAN", 0, "Boolean", ""}, - {PROP_INT, "INT", 0, "Integer", ""}, - {PROP_FLOAT, "FLOAT", 0, "Float", ""}, - {PROP_STRING, "STRING", 0, "String", ""}, - {PROP_ENUM, "ENUM", 0, "Enumeration", ""}, - {PROP_POINTER, "POINTER", 0, "Pointer", ""}, - {PROP_COLLECTION, "COLLECTION", 0, "Collection", ""}, - {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem subtype_items[] = { {PROP_NONE, "NONE", 0, "None", ""}, {PROP_FILEPATH, "FILE_PATH", 0, "File Path", ""}, @@ -961,7 +962,7 @@ static void rna_def_property(BlenderRNA *brna) prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); - RNA_def_property_enum_items(prop, type_items); + RNA_def_property_enum_items(prop, property_type_items); RNA_def_property_enum_funcs(prop, "rna_Property_type_get", NULL, NULL); RNA_def_property_ui_text(prop, "Type", "Data type of the property"); |