bugfix [#24884] Loading any preset leads to crash

caused by own recent commit. update uv operator template too.
This commit is contained in:
Campbell Barton 2010-11-24 18:37:54 +00:00
parent 2c70b1785c
commit 315879db11
2 changed files with 4 additions and 0 deletions

@ -11,6 +11,8 @@ def main(context):
if not mesh.uv_textures:
uvtex = bpy.ops.mesh.uv_texture_add()
else:
uvtex = mesh.uv_textures.active
# adjust UVs
for i, uv in enumerate(uvtex.data):

@ -380,12 +380,14 @@ int BPY_run_python_script( bContext *C, const char *fn, struct Text *text, struc
if(py_dict) {
#ifdef PYMODULE_CLEAR_WORKAROUND
PyObject *py_dict_back= PyDict_Copy(py_dict);
Py_INCREF(py_dict);
#endif
/* normal */
PyDict_SetItemString(PyThreadState_GET()->interp->modules, "__main__", Py_None);
#ifdef PYMODULE_CLEAR_WORKAROUND
PyDict_Clear(py_dict);
PyDict_Update(py_dict, py_dict_back);
Py_DECREF(py_dict);
Py_DECREF(py_dict_back);
#endif
#undef PYMODULE_CLEAR_WORKAROUND