diff options
Diffstat (limited to 'source/blender/editors/mesh/editmesh_undo.c')
-rw-r--r-- | source/blender/editors/mesh/editmesh_undo.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/source/blender/editors/mesh/editmesh_undo.c b/source/blender/editors/mesh/editmesh_undo.c index d75c92f963f..7bb1dc3723f 100644 --- a/source/blender/editors/mesh/editmesh_undo.c +++ b/source/blender/editors/mesh/editmesh_undo.c @@ -361,8 +361,6 @@ static void um_arraystore_compact_ex(UndoMesh *um, const UndoMesh *um_ref, bool if (create) { um_arraystore.users += 1; } - - BKE_mesh_update_customdata_pointers(me, false); } /** @@ -465,9 +463,6 @@ static void um_arraystore_expand(UndoMesh *um) BLI_assert(me->totselect == (state_len / stride)); UNUSED_VARS_NDEBUG(stride); } - - /* not essential, but prevents accidental dangling pointer access */ - BKE_mesh_update_customdata_pointers(me, false); } static void um_arraystore_free(UndoMesh *um) @@ -594,6 +589,10 @@ static void *undomesh_from_editmesh(UndoMesh *um, BMEditMesh *em, Key *key, Undo /* Uncomment for troubleshooting. */ // BM_mesh_validate(em->bm); + /* Copy the ID name characters to the mesh so code that depends on accessing the ID type can work + * on it. Necessary to use the attribute API. */ + strcpy(um->me.id.name, "MEundomesh_from_editmesh"); + BM_mesh_bm_to_me( NULL, em->bm, @@ -732,7 +731,7 @@ static void undomesh_free_data(UndoMesh *um) static Object *editmesh_object_from_context(bContext *C) { ViewLayer *view_layer = CTX_data_view_layer(C); - Object *obedit = OBEDIT_FROM_VIEW_LAYER(view_layer); + Object *obedit = BKE_view_layer_edit_object_get(view_layer); if (obedit && obedit->type == OB_MESH) { Mesh *me = obedit->data; if (me->edit_mesh != NULL) { |