Bug fix for:
[ #5000 ] Changin EditMode in Script wrecks memory Armatures create weakreferences in __main__.__dict__. When Window.Editmode is called, the weaklist it iterated over and armatures are updated.
This commit is contained in:
@@ -478,6 +478,7 @@ void BPY_Err_Handle( char *script_name )
|
||||
*****************************************************************************/
|
||||
int BPY_txt_do_python_Text( struct Text *text )
|
||||
{
|
||||
PyObject *maindict = NULL;
|
||||
PyObject *py_dict, *py_result;
|
||||
BPy_constant *info;
|
||||
char textname[24];
|
||||
@@ -524,6 +525,12 @@ int BPY_txt_do_python_Text( struct Text *text )
|
||||
|
||||
py_dict = CreateGlobalDictionary( );
|
||||
|
||||
//setup a weakref dictionary on __main__
|
||||
maindict= PyModule_GetDict(PyImport_AddModule( "__main__"));
|
||||
if (PyDict_SetItemString(maindict, "armatures", PyList_New(0)) == -1){
|
||||
return 0;
|
||||
}
|
||||
|
||||
script->py_globaldict = py_dict;
|
||||
|
||||
info = ( BPy_constant * ) PyConstant_New( );
|
||||
|
||||
Reference in New Issue
Block a user