diff options
author | Willian Padovani Germano <wpgermano@gmail.com> | 2003-07-04 06:56:07 +0400 |
---|---|---|
committer | Willian Padovani Germano <wpgermano@gmail.com> | 2003-07-04 06:56:07 +0400 |
commit | 28b8e667a0c2ef77dd862bc40909d089a96d1324 (patch) | |
tree | efc078e90cccadf505b40b15d35c8a351f386071 /source/blender/python/api2_2x/Camera.c | |
parent | 77213f7da686deb008f8e9b993325f1560919b9b (diff) |
Exppython:
- Fixed a problem with control of the global Python dictionary persistence:
Blender.ReleaseGlobalDict(bool) should now work fine.
- Trying to fix the sigsegv crashes on Windows:
They happen when we try to "print" our objects, like Lamps or Cameras.
Following advice from the Python Embedding doc, removed the tp_print
method from Camera and also improved its tp_repr one, that will be used
as print, repr() and str() for Cameras. If this test works all other objs
will be updated accordingly.
Diffstat (limited to 'source/blender/python/api2_2x/Camera.c')
-rw-r--r-- | source/blender/python/api2_2x/Camera.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/source/blender/python/api2_2x/Camera.c b/source/blender/python/api2_2x/Camera.c index 24dc7b5df42..913949789d4 100644 --- a/source/blender/python/api2_2x/Camera.c +++ b/source/blender/python/api2_2x/Camera.c @@ -50,8 +50,9 @@ PyTypeObject Camera_Type = 0, /* tp_itemsize */ /* methods */ (destructor)Camera_dealloc, /* tp_dealloc */ - (printfunc)Camera_print, /* tp_print */ - (getattrfunc)Camera_getAttr, /* tp_getattr */ +// (printfunc)Camera_print, /* tp_print */ + 0, /* tp_print */ + (getattrfunc)Camera_getAttr, /* tp_getattr */ (setattrfunc)Camera_setAttr, /* tp_setattr */ (cmpfunc)Camera_compare, /* tp_compare */ (reprfunc)Camera_repr, /* tp_repr */ @@ -582,14 +583,14 @@ static int Camera_compare (BPy_Camera *a, BPy_Camera *b) Camera *pa = a->camera, *pb = b->camera; return (pa == pb) ? 0:-1; } - +/* static int Camera_print(BPy_Camera *self, FILE *fp, int flags) { fprintf(fp, "[Camera \"%s\"]", self->camera->id.name+2); return 0; } - +*/ static PyObject *Camera_repr (BPy_Camera *self) { - return PyString_FromString(self->camera->id.name+2); + return PyString_FromFormat("[Camera \"%s\"]", self->camera->id.name+2); } |