forked from bartvdbraak/blender
bugfix [#24884] Loading any preset leads to crash
caused by own recent commit. update uv operator template too.
This commit is contained in:
parent
2c70b1785c
commit
315879db11
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user