[Bf-blender-cvs] [7714d6dd65f] blender2.8: COW Fix: Material property update callbacks need to tag depsgraph for COW updates

Joshua Leung noreply at git.blender.org
Mon Apr 30 14:54:05 CEST 2018


Commit: 7714d6dd65f3bce9d188f2c7bdde884fb920a602
Author: Joshua Leung
Date:   Mon Apr 30 14:46:30 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB7714d6dd65f3bce9d188f2c7bdde884fb920a602

COW Fix: Material property update callbacks need to tag depsgraph for COW updates

Otherwise, trying to change color/material properties of EEVEE materials
that have been keyframed doesn't work until a new keyframe has been inserted.

NOTE: There's still some wonkiness if you edit more than one keyframed value
before keyframing (i.e. the other unkeyed value temporarily gets reset). But
that's more of a general COW+animation issue.

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

M	source/blender/makesrna/intern/rna_material.c

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

diff --git a/source/blender/makesrna/intern/rna_material.c b/source/blender/makesrna/intern/rna_material.c
index 0621c1e1ad6..7dc76120097 100644
--- a/source/blender/makesrna/intern/rna_material.c
+++ b/source/blender/makesrna/intern/rna_material.c
@@ -90,7 +90,7 @@ static void rna_Material_update(Main *UNUSED(bmain), Scene *UNUSED(scene), Point
 {
 	Material *ma = ptr->id.data;
 
-	DEG_id_tag_update(&ma->id, 0);
+	DEG_id_tag_update(&ma->id, DEG_TAG_COPY_ON_WRITE);
 	WM_main_add_notifier(NC_MATERIAL | ND_SHADING, ma);
 }
 
@@ -108,7 +108,7 @@ static void rna_Material_draw_update(Main *UNUSED(bmain), Scene *UNUSED(scene),
 {
 	Material *ma = ptr->id.data;
 
-	DEG_id_tag_update(&ma->id, 0);
+	DEG_id_tag_update(&ma->id, DEG_TAG_COPY_ON_WRITE);
 	WM_main_add_notifier(NC_MATERIAL | ND_SHADING_DRAW, ma);
 }



More information about the Bf-blender-cvs mailing list