[Bf-blender-cvs] [c1361d26512] blender2.8: Depsgraph: tag depsgraph for copy-on-write flush when RNA changes

Dalai Felinto noreply at git.blender.org
Thu May 24 12:18:04 CEST 2018


Commit: c1361d2651222fb52839df038e92c18e1fdefc4e
Author: Dalai Felinto
Date:   Thu May 24 12:04:04 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBc1361d2651222fb52839df038e92c18e1fdefc4e

Depsgraph: tag depsgraph for copy-on-write flush when RNA changes

Fixes bug with changes to properties not being flushed to the COW data.
It fixes T55144.

This is the part of rBb4b745b72064 that is required although slow.
Which was partially addressed but the rest of the commit, which in
turn broke things. So for now let's get RNA to flush slow cow, and
deal with the consequences.

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

M	source/blender/makesdna/DNA_ID.h
M	source/blender/makesrna/intern/rna_access.c

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

diff --git a/source/blender/makesdna/DNA_ID.h b/source/blender/makesdna/DNA_ID.h
index acf054a94d5..4d59a7c9669 100644
--- a/source/blender/makesdna/DNA_ID.h
+++ b/source/blender/makesdna/DNA_ID.h
@@ -397,6 +397,10 @@ typedef enum ID_Type {
                                          ID_IS_STATIC_OVERRIDE((_id)) && \
                                          (((ID *)(_id))->override_static->flag & STATICOVERRIDE_AUTO))
 
+/* No copy-on-write for these types. */
+#define ID_TYPE_IS_COW(_id_type) \
+	(!ELEM(_id_type, ID_WM, ID_SCR, ID_SCRN, ID_IM, ID_MC, ID_LI))
+
 #ifdef GS
 #  undef GS
 #endif
diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c
index a6a834465ff..4c27d3d2226 100644
--- a/source/blender/makesrna/intern/rna_access.c
+++ b/source/blender/makesrna/intern/rna_access.c
@@ -2075,6 +2075,12 @@ static void rna_property_update(bContext *C, Main *bmain, Scene *scene, PointerR
 			/* we could add NULL check, for now don't */
 			WM_msg_publish_rna(mbus, ptr, prop);
 		}
+		if (ptr->id.data != NULL) {
+			const short id_type = GS(((ID *)ptr->id.data)->name);
+			if (ID_TYPE_IS_COW(id_type)) {
+				DEG_id_tag_update(ptr->id.data, DEG_TAG_COPY_ON_WRITE);
+			}
+		}
 #endif
 	}



More information about the Bf-blender-cvs mailing list