Store the context for python in a static variable with assessor functions - BPy_GetContext/BPy_SetContext,

Still not happy with this in the long term but its less problematic then storing the context in pythons namespace which couldn't be set before importing modules.

This might fix a crash quite a few people have reported (but I cant reproduce).
This commit is contained in:
2009-05-25 13:48:44 +00:00
parent edd783db73
commit 6d156a1bab
6 changed files with 23 additions and 25 deletions

View File

@@ -29,6 +29,13 @@
#include "MEM_guardedalloc.h"
#include "BKE_report.h"
#include "BKE_context.h"
bContext* __py_context = NULL;
bContext* BPy_GetContext(void) { return __py_context; };
void BPy_SetContext(bContext *C) { __py_context= C; };
PyObject *BPY_flag_to_list(struct BPY_flag_def *flagdef, int flag)
{
PyObject *list = PyList_New(0);