From 72e20785e1e2ed7b15a9765ebb6df646fd32dbff Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 7 Mar 2022 21:31:48 +1100 Subject: Fix T96205: Active shape key gets lost upon edit mode undo Regression in d961adb866cc2d7a95e4c6a7f06c49e346ec1abe, it's important that for the Mesh used for undo storage matches the shape-key instead of using the coordinates of the Basis key. Prior to bfdbc78466ac14d45f353db9aa39cb21bb962701 a different method of restoring the basis shape-key coordinates was used (restoring from the input `Mesh.mvert` array). When undo wrote the edit-mesh into the mesh this was always NULL so the basis shape keys coordinates were never used. Now a parameter has been added so undo can use the active shape for the meshes vertex coordinates. Reviewed By: sergey Maniphest Tasks: T96205 Ref D14258 --- source/blender/bmesh/intern/bmesh_mesh_convert.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source/blender/bmesh/intern/bmesh_mesh_convert.h') diff --git a/source/blender/bmesh/intern/bmesh_mesh_convert.h b/source/blender/bmesh/intern/bmesh_mesh_convert.h index 07ffc8b43df..6da5412a81c 100644 --- a/source/blender/bmesh/intern/bmesh_mesh_convert.h +++ b/source/blender/bmesh/intern/bmesh_mesh_convert.h @@ -69,6 +69,11 @@ struct BMeshToMeshParams { * that have become invalid from updating the shape-key, see T71865. */ uint update_shapekey_indices : 1; + /** + * Instead of copying the basis shape-key into the #MVert array, + * copy the #BMVert.co directly to #MVert.co (used for reading undo data). + */ + uint active_shapekey_to_mvert : 1; struct CustomData_MeshMasks cd_mask_extra; }; /** -- cgit v1.2.3