From 05f3e245a8e1a1ad327c6dc993551cdd832d4e3c Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 19 Feb 2018 17:27:01 +1100 Subject: Fix T54098: Crash existing /w dyntopo sculpt Optionally don't remap indices for objects. Checking all objects parent's would reference a freed pointer while freeing all objects. In the case of dynamic topology there is no use in keeping track of hook/vertex-parent indices. Also disable this when creating meshes for undo storage since adding an undo step shouldn't be modifying other objects. --- source/blender/python/bmesh/bmesh_py_types.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'source/blender/python') diff --git a/source/blender/python/bmesh/bmesh_py_types.c b/source/blender/python/bmesh/bmesh_py_types.c index 6ab5ebf3c81..2866683b89b 100644 --- a/source/blender/python/bmesh/bmesh_py_types.c +++ b/source/blender/python/bmesh/bmesh_py_types.c @@ -904,7 +904,11 @@ static PyObject *bpy_bmesh_to_mesh(BPy_BMesh *self, PyObject *args) /* python won't ensure matching uv/mtex */ BM_mesh_cd_validate(bm); - BM_mesh_bm_to_me(bm, me, (&(struct BMeshToMeshParams){0})); + BM_mesh_bm_to_me( + bm, me, + (&(struct BMeshToMeshParams){ + .calc_object_remap = true, + })); /* we could have the user do this but if they forget blender can easy crash * since the references arrays for the objects derived meshes are now invalid */ -- cgit v1.2.3