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:
@@ -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);
|
||||
|
Reference in New Issue
Block a user