[Bf-blender-cvs] [24bd483ee15] blender2.8: Object Modes: Flush COW on mode switching

Campbell Barton noreply at git.blender.org
Tue Jun 5 12:54:45 CEST 2018


Commit: 24bd483ee1551e2fb1dadea9fada98045700b5b2
Author: Campbell Barton
Date:   Tue Jun 5 12:19:14 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB24bd483ee1551e2fb1dadea9fada98045700b5b2

Object Modes: Flush COW on mode switching

Caused glitch w/ sculpt mode not updating.

===================================================================

M	source/blender/blenkernel/intern/particle.c
M	source/blender/editors/sculpt_paint/paint_vertex.c
M	source/blender/editors/sculpt_paint/sculpt.c

===================================================================

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);
 }



More information about the Bf-blender-cvs mailing list