small changes...

- allow RNA_property_enum_items to take the totitems int pointer as NULL (spares a loop on all the enum items). this change also makes enums types with no enum array crash in some places, could support these though Id rather disallow them, generating docs is a quick way to test for this.
- open recent file operator used and enum to open the recent file without an enum array, changed to an int type.
- added space_logic.py poll functions
This commit is contained in:
2009-06-23 12:36:15 +00:00
parent 502a3849bd
commit bf74f105bc
4 changed files with 30 additions and 22 deletions

View File

@@ -46,9 +46,9 @@
static int mathutils_rna_vector_cb_index= -1; /* index for our callbacks */
static int mathutils_rna_vector_check(PyObject *user)
static int mathutils_rna_vector_check(BPy_PropertyRNA *self)
{
return ((BPy_PropertyRNA *)user)->prop?1:0;
return self->prop?1:0;
}
static int mathutils_rna_vector_get(BPy_PropertyRNA *self, int subtype, float *vec_from)
@@ -190,7 +190,7 @@ static char *pyrna_enum_as_string(PointerRNA *ptr, PropertyRNA *prop)
const EnumPropertyItem *item;
int totitem;
RNA_property_enum_items(ptr, prop, &item, &totitem);
RNA_property_enum_items(ptr, prop, &item, NULL);
return (char*)BPy_enum_as_string((EnumPropertyItem*)item);
}