Page MenuHome
Paste P821

T57715 snippet
ActivePublic

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