From b9f6d66328b8b96d4f1fe29f761a99fbe531c4de Mon Sep 17 00:00:00 2001 From: Willian Padovani Germano Date: Tue, 13 May 2003 01:54:28 +0000 Subject: * Added 3 missing functions, 2 of them called by blender/src/drawtext.c: Callbacks registered with Draw.Register in Python are called now. That should fix submodule Blender.Draw. * Added a few other missing functions to BPY_interface.c * Finished implementing Get() function for Camera, Lamp, Image and Text: Both the .Get(name) and .Get() cases are handled now. * Added function Blender.ReleaseGlobalDict(): This function should give script writers control over whether the global Python Interpreter Dict should be cleared after the script is run (default is to clear). This is a test. --- source/blender/python/api2_2x/Blender.h | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'source/blender/python/api2_2x/Blender.h') diff --git a/source/blender/python/api2_2x/Blender.h b/source/blender/python/api2_2x/Blender.h index 50afa1053f7..19e3d686630 100644 --- a/source/blender/python/api2_2x/Blender.h +++ b/source/blender/python/api2_2x/Blender.h @@ -24,7 +24,7 @@ * * This is a new part of Blender. * - * Contributor(s): Michel Selten + * Contributor(s): Michel Selten, Willian P. Germano * * ***** END GPL/BL DUAL LICENSE BLOCK ***** */ @@ -50,12 +50,18 @@ /* From Window.h, used here by Blender_Redraw */ PyObject *M_Window_Redraw(PyObject *self, PyObject *args); +/* This global variable controls whether the global Interpreter dictionary + * should be cleared after a script is run. Default is to clear it. + * See Blender.ReleaseGlobalDict(bool) */ +extern short EXPP_releaseGlobalDict; + /*****************************************************************************/ /* Python API function prototypes for the Blender module. */ /*****************************************************************************/ PyObject *Blender_Set (PyObject *self, PyObject *args); PyObject *Blender_Get (PyObject *self, PyObject *args); PyObject *Blender_Redraw(PyObject *self, PyObject *args); +PyObject *Blender_ReleaseGlobalDict(PyObject *self, PyObject *args); /*****************************************************************************/ /* The following string definitions are used for documentation strings. */ @@ -81,6 +87,12 @@ char Blender_Get_doc[] = char Blender_Redraw_doc[] = "() - Redraw all 3D windows"; +char Blender_ReleaseGlobalDict_doc[] = +"(int) - Define whether the global Python Interpreter dictionary\n\ + should be cleared after the script is run. Default is\n\ + to clear (non-zero int).\n\ +() - Return the current behavior as a bool value (0 is false, 1 is true)\n"; + /*****************************************************************************/ /* Python method structure definition. */ /*****************************************************************************/ @@ -88,6 +100,8 @@ struct PyMethodDef Blender_methods[] = { {"Set", &Blender_Set, METH_VARARGS, Blender_Set_doc}, {"Get", &Blender_Get, METH_VARARGS, Blender_Get_doc}, {"Redraw", &Blender_Redraw, METH_VARARGS, Blender_Redraw_doc}, + {"ReleaseGlobalDict", &Blender_ReleaseGlobalDict, + METH_VARARGS, Blender_ReleaseGlobalDict_doc}, {NULL, NULL} }; -- cgit v1.2.3