Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2021-02-25 07:43:30 +0300
committerCampbell Barton <ideasman42@gmail.com>2021-02-25 08:13:53 +0300
commite301f3422d9922598e0cabf12a4e22eda0ae0880 (patch)
tree630560a8b65b50b212b0d010972bf1cd8ec299f0 /source/blender/editors/mesh/editmesh_undo.c
parent2b60d7d09c51716e8d98834061c1a61ed6b96cf5 (diff)
Fix T85974: Edit-mode undo/redo causes assertion
Assert the poll function succeeds after setting the active object.
Diffstat (limited to 'source/blender/editors/mesh/editmesh_undo.c')
-rw-r--r--source/blender/editors/mesh/editmesh_undo.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/editors/mesh/editmesh_undo.c b/source/blender/editors/mesh/editmesh_undo.c
index cea006f0faa..e46363eafcc 100644
--- a/source/blender/editors/mesh/editmesh_undo.c
+++ b/source/blender/editors/mesh/editmesh_undo.c
@@ -39,6 +39,7 @@
#include "BKE_lib_id.h"
#include "BKE_main.h"
#include "BKE_mesh.h"
+#include "BKE_object.h"
#include "BKE_undo_system.h"
#include "DEG_depsgraph.h"
@@ -778,7 +779,7 @@ static void mesh_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(mesh_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++) {
MeshUndoStep_Elem *elem = &us->elems[i];
@@ -802,6 +803,9 @@ static void mesh_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(mesh_undosys_poll(C));
+
Scene *scene = CTX_data_scene(C);
scene->toolsettings->selectmode = us->elems[0].data.selectmode;