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/blenkernel/intern/object.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/blenkernel/intern/object.c')
-rw-r--r--source/blender/blenkernel/intern/object.c49
1 files changed, 49 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c
index 773e2d19b22..b50e152527e 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -81,6 +81,7 @@
#include "BKE_curve.h"
#include "BKE_displist.h"
#include "BKE_effect.h"
+#include "BKE_font.h"
#include "BKE_fcurve.h"
#include "BKE_gpencil_modifier.h"
#include "BKE_icons.h"
@@ -629,6 +630,54 @@ bool BKE_object_data_is_in_editmode(const ID *id)
}
}
+char *BKE_object_data_editmode_flush_ptr_get(struct ID *id)
+{
+ const short type = GS(id->name);
+ switch (type) {
+ case ID_ME: {
+ BMEditMesh *em = ((Mesh *)id)->edit_mesh;
+ if (em != NULL) {
+ return &em->needs_flush_to_id;
+ }
+ break;
+ }
+ case ID_CU: {
+ if (((Curve *)id)->vfont != NULL) {
+ EditFont *ef = ((Curve *)id)->editfont;
+ if (ef != NULL) {
+ return &ef->needs_flush_to_id;
+ }
+ }
+ else {
+ EditNurb *editnurb = ((Curve *)id)->editnurb;
+ if (editnurb) {
+ return &editnurb->needs_flush_to_id;
+ }
+ }
+ break;
+ }
+ case ID_MB: {
+ MetaBall *mb = (MetaBall *)id;
+ return &mb->needs_flush_to_id;
+ }
+ case ID_LT: {
+ EditLatt *editlatt = ((Lattice *)id)->editlatt;
+ if (editlatt) {
+ return &editlatt->needs_flush_to_id;
+ }
+ break;
+ }
+ case ID_AR: {
+ bArmature *arm = (bArmature *)id;
+ return &arm->needs_flush_to_id;
+ }
+ default:
+ BLI_assert(0);
+ return NULL;
+ }
+ return NULL;
+}
+
bool BKE_object_is_in_wpaint_select_vert(const Object *ob)
{
if (ob->type == OB_MESH) {