diff options
Diffstat (limited to 'source/blender/editors/metaball')
-rw-r--r-- | source/blender/editors/metaball/editmball_undo.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/source/blender/editors/metaball/editmball_undo.c b/source/blender/editors/metaball/editmball_undo.c index b817bc3a718..86f67879c5f 100644 --- a/source/blender/editors/metaball/editmball_undo.c +++ b/source/blender/editors/metaball/editmball_undo.c @@ -38,6 +38,7 @@ #include "BKE_context.h" #include "BKE_layer.h" #include "BKE_main.h" +#include "BKE_object.h" #include "BKE_undo_system.h" #include "DEG_depsgraph.h" @@ -199,7 +200,7 @@ static void mball_undosys_step_decode(struct bContext *C, ED_undo_object_editmode_restore_helper( C, &us->elems[0].obedit_ref.ptr, us->elems_len, sizeof(*us->elems)); - BLI_assert(mball_undosys_poll(C)); + BLI_assert(BKE_object_is_in_editmode(us->elems[0].obedit_ref.ptr)); for (uint i = 0; i < us->elems_len; i++) { MBallUndoStep_Elem *elem = &us->elems[i]; @@ -222,6 +223,12 @@ static void mball_undosys_step_decode(struct bContext *C, ED_undo_object_set_active_or_warn( CTX_data_view_layer(C), us->elems[0].obedit_ref.ptr, us_p->name, &LOG); + /* Check after setting active. */ + + BLI_assert(BKE_object_is_in_editmode(us->elems[0].obedit_ref.ptr)); + + BLI_assert(mball_undosys_poll(C)); + bmain->is_memfile_undo_flush_needed = true; WM_event_add_notifier(C, NC_GEOM | ND_DATA, NULL); |