[Bf-blender-cvs] [01dec326edb] master: Fix T62366: Grease pencil material color keying

Sergey Sharybin noreply at git.blender.org
Mon Mar 11 16:49:55 CET 2019


Commit: 01dec326edb046d5fec272bfe62f178a2dc3e519
Author: Sergey Sharybin
Date:   Mon Mar 11 16:48:19 2019 +0100
Branches: master
https://developer.blender.org/rB01dec326edb046d5fec272bfe62f178a2dc3e519

Fix T62366: Grease pencil material color keying

Do proper tagging for material changes, and avoid grease-pencil hack
in the relations builder.

The dependency graph code was forcing animation to be run for any
copy-on-write change of material. However, animation is not supposed
to be run on copy-on-write changes.

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

M	source/blender/depsgraph/intern/builder/deg_builder_relations.cc
M	source/blender/makesrna/intern/rna_material.c

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

diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
index d6670ec2afa..fe1ef81262d 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
@@ -2623,10 +2623,6 @@ void DepsgraphRelationBuilder::build_copy_on_write_relations(IDNode *id_node)
 		if (id_type == ID_ME && comp_node->type == NodeType::GEOMETRY) {
 			rel_flag &= ~RELATION_FLAG_NO_FLUSH;
 		}
-		/* materials need update grease pencil objects */
-		if (id_type == ID_MA) {
-			rel_flag &= ~RELATION_FLAG_NO_FLUSH;
-		}
 		/* Notes on exceptions:
 		 * - Parameters component is where drivers are living. Changing any
 		 *   of the (custom) properties in the original datablock (even the
diff --git a/source/blender/makesrna/intern/rna_material.c b/source/blender/makesrna/intern/rna_material.c
index 90c46c8b03d..994efc36f00 100644
--- a/source/blender/makesrna/intern/rna_material.c
+++ b/source/blender/makesrna/intern/rna_material.c
@@ -91,7 +91,7 @@ static void rna_Material_update(Main *UNUSED(bmain), Scene *UNUSED(scene), Point
 {
 	Material *ma = ptr->id.data;
 
-	DEG_id_tag_update(&ma->id, ID_RECALC_COPY_ON_WRITE);
+	DEG_id_tag_update(&ma->id, ID_RECALC_SHADING);
 	WM_main_add_notifier(NC_MATERIAL | ND_SHADING, ma);
 }
 
@@ -125,7 +125,7 @@ static void rna_Material_draw_update(Main *UNUSED(bmain), Scene *UNUSED(scene),
 {
 	Material *ma = ptr->id.data;
 
-	DEG_id_tag_update(&ma->id, ID_RECALC_COPY_ON_WRITE);
+	DEG_id_tag_update(&ma->id, ID_RECALC_SHADING);
 	WM_main_add_notifier(NC_MATERIAL | ND_SHADING_DRAW, ma);
 }



More information about the Bf-blender-cvs mailing list