diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-09-01 19:25:22 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-09-01 19:25:22 +0400 |
commit | 70ec45d7578afaa57f2b2dac1f0dd86ee38fca81 (patch) | |
tree | 79eb5019fa791c90224656bcc1ac99cd871864e7 /source/blender/python | |
parent | da31d2628e4bac6ce3d6d587d299c75557318c4b (diff) |
have rna function obj.as_pointer() return a memory address rather then a PyCapsule object.
this can be passed to ctypes.c_void_p(bpy.context.object.as_pointer())
Diffstat (limited to 'source/blender/python')
-rw-r--r-- | source/blender/python/intern/bpy_rna.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index 3a7ee4806e9..0196366995b 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -2909,19 +2909,16 @@ static PyObject *pyrna_struct_get(BPy_StructRNA *self, PyObject *args) static char pyrna_struct_as_pointer_doc[] = ".. method:: as_pointer()\n" "\n" -" Returns capsule which holds a pointer to blenders internal data\n" +" Returns the memory address which holds a pointer to blenders internal data\n" "\n" " :return: capsule with a name set from the struct type.\n" -" :rtype: PyCapsule\n" +" :rtype: int\n" "\n" " .. note:: This is intended only for advanced script writers who need to pass blender data to their own C/Python modules.\n"; static PyObject *pyrna_struct_as_pointer(BPy_StructRNA *self) { - if(self->ptr.data) - return PyCapsule_New(self->ptr.data, RNA_struct_identifier(self->ptr.type), NULL); - - Py_RETURN_NONE; + return PyLong_FromVoidPtr(self->ptr.data); } static PyObject *pyrna_prop_get(BPy_PropertyRNA *self, PyObject *args) |