[Bf-blender-cvs] [abab0398a02] greasepencil-object: Fix grease pencil cache update problems when change material properties

Antonio Vazquez noreply at git.blender.org
Sat Jul 14 11:13:40 CEST 2018


Commit: abab0398a02d643d88bd65e45ce6dca79d3691d4
Author: Antonio Vazquez
Date:   Sat Jul 14 11:13:33 2018 +0200
Branches: greasepencil-object
https://developer.blender.org/rBabab0398a02d643d88bd65e45ce6dca79d3691d4

Fix grease pencil cache update problems when change material properties

Since commit f84956738ba4e97f30553a675b643f6648afce1d 6/07/2018 12:33, the update of the materials was not working because depsgraph only update the current ID and not all related.

This fix the issue but need a review.

@aligorith Could you take a look and check if this is the best solution, I'm not sure about the fix, maybe we could add a relationship between material and datablock when create a new material.

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

M	source/blender/depsgraph/intern/builder/deg_builder_relations.cc

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

diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
index a668970e2bd..46da89786d9 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
@@ -2292,6 +2292,11 @@ void DepsgraphRelationBuilder::build_copy_on_write_relations(IDDepsNode *id_node
 		if (id_type == ID_ME && comp_node->type == DEG_NODE_TYPE_GEOMETRY) {
 			rel_flag &= ~DEPSREL_FLAG_NO_FLUSH;
 		}
+		/* materials need update grease pencil objects */
+		if (id_type == ID_MA) {
+			rel_flag &= ~DEPSREL_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



More information about the Bf-blender-cvs mailing list