subtype support for properties in bpy.props.

This commit is contained in:
2010-02-01 22:04:33 +00:00
parent 26cfe812f8
commit 039d087171
18 changed files with 413 additions and 104 deletions

View File

@@ -1034,6 +1034,17 @@ int RNA_enum_name(EnumPropertyItem *item, const int value, const char **name)
return 0;
}
int RNA_enum_value(EnumPropertyItem *item, const char *name, int *r_value)
{
for (; item->identifier; item++) {
if(item->identifier[0] && strcmp(item->identifier, name)==0) {
*r_value= item->value;
return 1;
}
}
return 0;
}
int RNA_property_enum_identifier(bContext *C, PointerRNA *ptr, PropertyRNA *prop, const int value, const char **identifier)
{
EnumPropertyItem *item= NULL;