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>2019-11-07 08:52:03 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-11-07 08:56:21 +0300
commit79b703bb635ea719bbe31c1ece9884d2d298eaef (patch)
tree7ee7e896e8e66233f85dd425708a595f66607f48 /source/blender/editors/object/object_edit.c
parent85637311c28f49b55286d3287d4c7cefbcbca18a (diff)
Fix T69822: Switching sculpt objects breaks undo
This introduces object mode tagging for data which hasn't yet been written back to the ID data. Now when selecting other sculpt objects, the original objects data is flushed back to the ID before writing a memfile undo step.
Diffstat (limited to 'source/blender/editors/object/object_edit.c')
-rw-r--r--source/blender/editors/object/object_edit.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c
index 70d024c7902..be815fb0d10 100644
--- a/source/blender/editors/object/object_edit.c
+++ b/source/blender/editors/object/object_edit.c
@@ -514,6 +514,11 @@ static bool ED_object_editmode_load_ex(Main *bmain, Object *obedit, const bool f
}
}
+ char *needs_flush_ptr = BKE_object_data_editmode_flush_ptr_get(obedit->data);
+ if (needs_flush_ptr) {
+ *needs_flush_ptr = false;
+ }
+
return true;
}
@@ -616,10 +621,13 @@ bool ED_object_editmode_enter_ex(Main *bmain, Scene *scene, Object *ob, int flag
WM_main_add_notifier(NC_SCENE | ND_MODE | NS_EDITMODE_MESH, NULL);
}
else if (ob->type == OB_ARMATURE) {
+ bArmature *arm = ob->data;
ok = 1;
- ED_armature_to_edit(ob->data);
+ ED_armature_to_edit(arm);
/* to ensure all goes in restposition and without striding */
+ arm->needs_flush_to_id = 0;
+
/* XXX: should this be ID_RECALC_GEOMETRY? */
DEG_id_tag_update(&ob->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY | ID_RECALC_ANIMATION);
@@ -632,9 +640,13 @@ bool ED_object_editmode_enter_ex(Main *bmain, Scene *scene, Object *ob, int flag
WM_main_add_notifier(NC_SCENE | ND_MODE | NS_EDITMODE_TEXT, scene);
}
else if (ob->type == OB_MBALL) {
+ MetaBall *mb = ob->data;
+
ok = 1;
ED_mball_editmball_make(ob);
+ mb->needs_flush_to_id = 0;
+
WM_main_add_notifier(NC_SCENE | ND_MODE | NS_EDITMODE_MBALL, scene);
}
else if (ob->type == OB_LATTICE) {