bmesh py api:

add mtexpoly image access
This commit is contained in:
2012-05-01 06:50:43 +00:00
parent ae4fda82b0
commit 9fe1fe0aa8
6 changed files with 127 additions and 6 deletions

View File

@@ -6254,6 +6254,31 @@ PyObject *pyrna_prop_CreatePyObject(PointerRNA *ptr, PropertyRNA *prop)
return (PyObject *)pyrna;
}
/* utility func to be used by external modules, *sneaky!* */
PyObject *pyrna_id_CreatePyObject(ID *id)
{
if (id) {
PointerRNA ptr;
RNA_id_pointer_create(id, &ptr);
return pyrna_struct_CreatePyObject(&ptr);
}
else {
Py_RETURN_NONE;
}
}
int pyrna_id_FromPyObject(PyObject *obj, ID **id)
{
if (BPy_StructRNA_Check(obj) && (RNA_struct_is_ID(((BPy_StructRNA *)obj)->ptr.type))) {
*id = ((BPy_StructRNA *)obj)->ptr.id.data;
return TRUE;
}
else {
*id = NULL;
return FALSE;
}
}
void BPY_rna_init(void)
{
#ifdef USE_MATHUTILS // register mathutils callbacks, ok to run more then once.