From 24bd483ee1551e2fb1dadea9fada98045700b5b2 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 5 Jun 2018 12:19:14 +0200 Subject: Object Modes: Flush COW on mode switching Caused glitch w/ sculpt mode not updating. --- source/blender/blenkernel/intern/particle.c | 3 +++ source/blender/editors/sculpt_paint/paint_vertex.c | 4 ++++ source/blender/editors/sculpt_paint/sculpt.c | 4 ++++ 3 files changed, 11 insertions(+) diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c index 9550cbc6b50..2cd3ff1ccf3 100644 --- a/source/blender/blenkernel/intern/particle.c +++ b/source/blender/blenkernel/intern/particle.c @@ -3089,6 +3089,9 @@ void object_remove_particle_system(Scene *UNUSED(scene), Object *ob) DEG_relations_tag_update(G.main); DEG_id_tag_update(&ob->id, OB_RECALC_DATA); + + /* Flush object mode. */ + DEG_id_tag_update(&ob->id, DEG_TAG_COPY_ON_WRITE); } static void default_particle_settings(ParticleSettings *part) diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c index 53b73562322..a6b5ae1af29 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex.c +++ b/source/blender/editors/sculpt_paint/paint_vertex.c @@ -1108,6 +1108,9 @@ static void ed_vwpaintmode_enter_generic( } vertex_paint_init_session(depsgraph, scene, ob); + + /* Flush object mode. */ + DEG_id_tag_update(&ob->id, DEG_TAG_COPY_ON_WRITE); } void ED_object_vpaintmode_enter_ex( @@ -1189,6 +1192,7 @@ static void ed_vwpaintmode_exit_generic( ED_mesh_mirror_topo_table(NULL, NULL, 'e'); } + /* Flush object mode. */ DEG_id_tag_update(&ob->id, DEG_TAG_COPY_ON_WRITE); } diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index 5dd7f23864c..985857d3f7a 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -5735,6 +5735,9 @@ void ED_object_sculptmode_enter_ex( } // ED_workspace_object_mode_sync_from_object(G.main->wm.first, workspace, ob); + + /* Flush object mode. */ + DEG_id_tag_update(&ob->id, DEG_TAG_COPY_ON_WRITE); } void ED_object_sculptmode_enter(struct bContext *C, ReportList *reports) @@ -5788,6 +5791,7 @@ void ED_object_sculptmode_exit_ex( paint_cursor_delete_textures(); + /* Flush object mode. */ DEG_id_tag_update(&ob->id, DEG_TAG_COPY_ON_WRITE); } -- cgit v1.2.3