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:
authorWillian Padovani Germano <wpgermano@gmail.com>2003-09-03 08:13:08 +0400
committerWillian Padovani Germano <wpgermano@gmail.com>2003-09-03 08:13:08 +0400
commita09e5a7f2f3ae81f504106eeb62373bb99b39b51 (patch)
tree838de24f316bcf1a5a1d15d057338ef8cf2d7108 /source/blender/python/BPY_interface.c
parent65746ab10a1031e4a1275c21051bce0064be5219 (diff)
Exppython:
- Window: added .GetCursorPos() - Lamp: updated for NoDiffuse and NoSpecular modes - Registry: new module to handle persistent data - vector: made it correctly print only 3 values when vec->size==3: Fixes nmvert coords printed with a 4th 0.0 coordinate - Text: fixed crash on startup (Python 2.3, linux): added definition of the Text pyobject earlier, in Types.c
Diffstat (limited to 'source/blender/python/BPY_interface.c')
-rw-r--r--source/blender/python/BPY_interface.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/source/blender/python/BPY_interface.c b/source/blender/python/BPY_interface.c
index 722f7934462..684b5bdc520 100644
--- a/source/blender/python/BPY_interface.c
+++ b/source/blender/python/BPY_interface.c
@@ -61,6 +61,11 @@
#include "BPY_extern.h"
#include "api2_2x/EXPP_interface.h"
+/* bpy_registryDict is declared in api2_2x/Registry.h and defined
+ * here. This Python dictionary will be used to store data that scripts
+ * choose to preserve after they are executed, so user changes can be
+ * restored next time the script is used. Check the Blender.Registry module. */
+extern PyObject *bpy_registryDict;
/*****************************************************************************/
/* Structure definitions */
@@ -96,6 +101,11 @@ PyObject *blender_import(PyObject *self, PyObject *args);
/*****************************************************************************/
void BPY_start_python(void)
{
+ bpy_registryDict = PyDict_New(); /* check comment at start of this file */
+
+ if (!bpy_registryDict)
+ printf("Error: Couldn't create the Registry Python Dictionary!");
+
/* TODO: Shouldn't "blender" be replaced by PACKAGE ?? (config.h) */
Py_SetProgramName("blender");
@@ -115,6 +125,11 @@ void BPY_start_python(void)
/*****************************************************************************/
void BPY_end_python(void)
{
+ if (bpy_registryDict) {
+ Py_DECREF (bpy_registryDict);
+ bpy_registryDict = NULL;
+ }
+
Py_Finalize();
return;
}