From 6d0cae56e84306ed64a51005c4fb1811a40822b7 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 29 Apr 2016 22:33:06 +1000 Subject: Fix T48290: Hook fails after deleting geometry Now CD_SHAPEKEY_INDEX customdata is stored in edit-mode when hooks and vertex parents are used. This also fixes a bug where undo would loose key-index data. Move to structs for BM_mesh_bm_to/from_me to avoid passing many argument, which mostly aren't used. --- source/blender/python/bmesh/bmesh_py_types.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'source/blender/python/bmesh') diff --git a/source/blender/python/bmesh/bmesh_py_types.c b/source/blender/python/bmesh/bmesh_py_types.c index 3c45cb93514..a0722af522b 100644 --- a/source/blender/python/bmesh/bmesh_py_types.c +++ b/source/blender/python/bmesh/bmesh_py_types.c @@ -916,7 +916,7 @@ 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, false); + BM_mesh_bm_to_me(bm, me, (&(struct BMeshToMeshParams){0})); /* 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 */ @@ -1075,7 +1075,10 @@ static PyObject *bpy_bmesh_from_mesh(BPy_BMesh *self, PyObject *args, PyObject * bm = self->bm; - BM_mesh_bm_from_me(bm, me, use_fnorm, use_shape_key, shape_key_index + 1); + BM_mesh_bm_from_me( + bm, me, (&(struct BMeshFromMeshParams){ + .calc_face_normal = use_fnorm, .use_shapekey = use_shape_key, .active_shapekey = shape_key_index + 1, + })); Py_RETURN_NONE; } -- cgit v1.2.3