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
This commit is contained in:
2003-09-03 04:13:08 +00:00
parent 65746ab10a
commit a09e5a7f2f
11 changed files with 330 additions and 17 deletions

View File

@@ -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;
}