diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-06-26 08:17:41 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-06-26 08:17:41 +0400 |
commit | c0c9f5386bac539e3824a5a97bd2243484598594 (patch) | |
tree | e1b40ad75e51f7c76707b7506312a11339742f4e /source/blender/python | |
parent | 7d608452d0c10da9b71ca37cb3bdbdfe0e5ebe36 (diff) |
fix [#35507] BMesh module: Crash on to_mesh() if faces.layers.tex is used but no loops.layers.uv
Diffstat (limited to 'source/blender/python')
-rw-r--r-- | source/blender/python/bmesh/bmesh_py_api.c | 6 | ||||
-rw-r--r-- | source/blender/python/bmesh/bmesh_py_types.c | 3 |
2 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/python/bmesh/bmesh_py_api.c b/source/blender/python/bmesh/bmesh_py_api.c index 99fd3429973..c7b10d0aa4b 100644 --- a/source/blender/python/bmesh/bmesh_py_api.c +++ b/source/blender/python/bmesh/bmesh_py_api.c @@ -138,6 +138,12 @@ static PyObject *bpy_bm_update_edit_mesh(PyObject *UNUSED(self), PyObject *args, { extern void EDBM_update_generic(BMEditMesh *em, const bool do_tessface, const bool is_destructive); + BMEditMesh *em = me->edit_btmesh; + BMesh *bm = em->bm; + + /* python won't ensure matching uv/mtex */ + BM_mesh_cd_validate(bm); + EDBM_update_generic(me->edit_btmesh, do_tessface, is_destructive); } diff --git a/source/blender/python/bmesh/bmesh_py_types.c b/source/blender/python/bmesh/bmesh_py_types.c index 6ea8d6c68ce..0db8b07d5f5 100644 --- a/source/blender/python/bmesh/bmesh_py_types.c +++ b/source/blender/python/bmesh/bmesh_py_types.c @@ -907,6 +907,9 @@ static PyObject *bpy_bmesh_to_mesh(BPy_BMesh *self, PyObject *args) bm = self->bm; + /* python won't ensure matching uv/mtex */ + BM_mesh_cd_validate(bm); + BM_mesh_bm_to_me(bm, me, false); /* we could have the user do this but if they forget blender can easy crash |