From 79b703bb635ea719bbe31c1ece9884d2d298eaef Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 7 Nov 2019 16:52:03 +1100 Subject: 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. --- source/blender/blenkernel/BKE_paint.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'source/blender/blenkernel/BKE_paint.h') diff --git a/source/blender/blenkernel/BKE_paint.h b/source/blender/blenkernel/BKE_paint.h index 4413ad2a70f..48f9e1fd95e 100644 --- a/source/blender/blenkernel/BKE_paint.h +++ b/source/blender/blenkernel/BKE_paint.h @@ -306,6 +306,13 @@ typedef struct SculptSession { /* This flag prevents PBVH from being freed when creating the vp_handle for texture paint. */ bool building_vp_handle; + + /** + * ID data is older than sculpt-mode data. + * Set #Main.is_memfile_undo_flush_needed when enabling. + */ + char needs_flush_to_id; + } SculptSession; void BKE_sculptsession_free(struct Object *ob); -- cgit v1.2.3