diff options
author | Campbell Barton <ideasman42@gmail.com> | 2016-04-29 15:33:06 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2016-04-29 16:39:50 +0300 |
commit | 6d0cae56e84306ed64a51005c4fb1811a40822b7 (patch) | |
tree | de25f4c347865a2aefe7d33b8ab5920d35718254 /source/blender/python | |
parent | b5ce2bbef7a91f81c3556f2ddf6dd5f21161bc91 (diff) |
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.
Diffstat (limited to 'source/blender/python')
-rw-r--r-- | source/blender/python/bmesh/bmesh_py_types.c | 7 |
1 files changed, 5 insertions, 2 deletions
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; } |