Paste P821

T57715 snippet
ActivePublic

Authored by Philipp Oeser (lichtwerk) on Fri, Nov 9, 12:33 PM.
1
2
3diff --git a/source/blender/editors/mesh/editmesh_undo.c b/source/blender/editors/mesh/editmesh_undo.c
4index 26f3c17a97c..aac1578c274 100644
5--- a/source/blender/editors/mesh/editmesh_undo.c
6+++ b/source/blender/editors/mesh/editmesh_undo.c
7@@ -717,8 +717,14 @@ static bool mesh_undosys_step_encode(struct bContext *C, UndoStep *us_p)
8
9elem->obedit_ref.ptr = ob;
10Mesh *me = elem->obedit_ref.ptr->data;
11- undomesh_from_editmesh(&elem->data, me->edit_btmesh, me->key);
12- us->step.data_size += elem->data.undo_size;
13+ if (!me->edit_btmesh) {
14+ printf("no edit_btmesh: %s\n", ob->id.name);
15+ us->elems_len -= 1;
16+ }
17+ else {
18+ undomesh_from_editmesh(&elem->data, me->edit_btmesh, me->key);
19+ us->step.data_size += elem->data.undo_size;
20+ }
21}
22MEM_freeN(objects);
23return true;