Python Panels WIP
- Register python panels - Added a generic class checking function BPY_class_validate() for panels/operators. - No button drawing yet Brecht, Added RNA_enum_value_from_id() and RNA_enum_id_from_value() to rna_access.c to do lookups between identifiers and values of EnumPropertyItem's, Not sure if these should go here.
This commit is contained in:
@@ -128,20 +128,9 @@ static char *pyrna_enum_as_string(PointerRNA *ptr, PropertyRNA *prop)
|
||||
{
|
||||
const EnumPropertyItem *item;
|
||||
int totitem, i;
|
||||
|
||||
DynStr *dynstr= BLI_dynstr_new();
|
||||
char *cstring;
|
||||
|
||||
RNA_property_enum_items(ptr, prop, &item, &totitem);
|
||||
|
||||
for (i=0; i<totitem; i++) {
|
||||
|
||||
BLI_dynstr_appendf(dynstr, i?", '%s'":"'%s'", item[i].identifier);
|
||||
}
|
||||
|
||||
cstring = BLI_dynstr_get_cstring(dynstr);
|
||||
BLI_dynstr_free(dynstr);
|
||||
return cstring;
|
||||
RNA_property_enum_items(ptr, prop, &item, &totitem);
|
||||
return BPy_enum_as_string(item);
|
||||
}
|
||||
|
||||
PyObject * pyrna_prop_to_py(PointerRNA *ptr, PropertyRNA *prop)
|
||||
|
||||
Reference in New Issue
Block a user