Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2010-09-01 19:25:22 +0400
committerCampbell Barton <ideasman42@gmail.com>2010-09-01 19:25:22 +0400
commit70ec45d7578afaa57f2b2dac1f0dd86ee38fca81 (patch)
tree79eb5019fa791c90224656bcc1ac99cd871864e7 /source/blender/python
parentda31d2628e4bac6ce3d6d587d299c75557318c4b (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.c9
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)