diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-09-17 10:14:09 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-09-17 10:14:09 +0400 |
commit | d1cde59ed3326d1dc6c240a44523b01538c81c25 (patch) | |
tree | b1831776d5c1426d42f098fca9ab2bcc14a13065 /source | |
parent | 7ecc9951a94e590e26411104b78caf1729db9584 (diff) |
fix [#32442] UNDO causes actual shape key to be lost, undoing a modification of another shape key.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/mesh/editmesh_utils.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/source/blender/editors/mesh/editmesh_utils.c b/source/blender/editors/mesh/editmesh_utils.c index 03e2f2691a8..09512fc5466 100644 --- a/source/blender/editors/mesh/editmesh_utils.c +++ b/source/blender/editors/mesh/editmesh_utils.c @@ -535,6 +535,16 @@ static void *getEditMesh(bContext *C) typedef struct UndoMesh { Mesh me; int selectmode; + + /** \note + * this isn't a prefect solution, if you edit keys and change shapes this works well (fixing [#32442]), + * but editing shape keys, going into object mode, removing or changing their order, + * then go back into editmode and undo will give issues - where the old index will be out of sync + * with the new object index. + * + * There are a few ways this could be made to work but for now its a known limitation with mixing + * object and editmode operations - Campbell */ + int shapenr; } UndoMesh; /* undo simply makes copies of a bmesh */ @@ -553,6 +563,7 @@ static void *editbtMesh_to_undoMesh(void *emv, void *obdata) BM_mesh_bm_to_me(em->bm, &um->me, FALSE); um->selectmode = em->selectmode; + um->shapenr = em->bm->shapenr; return um; } @@ -564,7 +575,7 @@ static void undoMesh_to_editbtMesh(void *umv, void *em_v, void *UNUSED(obdata)) UndoMesh *um = umv; BMesh *bm; - ob->shapenr = em->bm->shapenr; + ob->shapenr = em->bm->shapenr = um->shapenr; EDBM_mesh_free(em); |