~ubuntu-branches/ubuntu/trusty/blender/trusty

« back to all changes in this revision

Viewing changes to source/blender/python/intern/bpy_rna.c

  • Committer: Package Import Robot
  • Author(s): Matteo F. Vescovi
  • Date: 2012-05-12 20:02:22 UTC
  • mfrom: (14.2.16 sid)
  • Revision ID: package-import@ubuntu.com-20120512200222-lznjs2cxzaq96wua
Tags: 2.63a-1
* New upstream bugfix release
  + debian/patches/: re-worked since source code changed

Show diffs side-by-side

added added

removed removed

Lines of Context:
6246
6246
        return (PyObject *)pyrna;
6247
6247
}
6248
6248
 
 
6249
/* utility func to be used by external modules, *sneaky!* */
 
6250
PyObject *pyrna_id_CreatePyObject(ID *id)
 
6251
{
 
6252
        if (id) {
 
6253
                PointerRNA ptr;
 
6254
                RNA_id_pointer_create(id, &ptr);
 
6255
                return pyrna_struct_CreatePyObject(&ptr);
 
6256
        }
 
6257
        else {
 
6258
                Py_RETURN_NONE;
 
6259
        }
 
6260
}
 
6261
 
 
6262
int pyrna_id_FromPyObject(PyObject *obj, ID **id)
 
6263
{
 
6264
        if (BPy_StructRNA_Check(obj) && (RNA_struct_is_ID(((BPy_StructRNA *)obj)->ptr.type))) {
 
6265
                *id = ((BPy_StructRNA *)obj)->ptr.id.data;
 
6266
                return TRUE;
 
6267
        }
 
6268
        else {
 
6269
                *id = NULL;
 
6270
                return FALSE;
 
6271
        }
 
6272
}
 
6273
 
6249
6274
void BPY_rna_init(void)
6250
6275
{
6251
6276
#ifdef USE_MATHUTILS // register mathutils callbacks, ok to run more then once.