[Bf-blender-cvs] [b88d891] master: Fix T45633 - Animated modifiers don't update in new depsgraph

Joshua Leung noreply at git.blender.org
Sun Aug 23 12:24:59 CEST 2015


Commit: b88d8916e44f998c4f0bc397b29b0d6ff0f011e9
Author: Joshua Leung
Date:   Sun Aug 23 22:12:25 2015 +1200
Branches: master
https://developer.blender.org/rBb88d8916e44f998c4f0bc397b29b0d6ff0f011e9

Fix T45633 - Animated modifiers don't update in new depsgraph

* Resolved some todo's where FModifier paths were getting identified using the
  wrong pattern.
* Added the missing animation -> modifier link. The "hacky" part here is just
  to do with how we check if that link is needed; the link though should exist
  in the graph.

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

M	source/blender/blenkernel/intern/object.c
M	source/blender/depsgraph/intern/depsgraph_build_relations.cc

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

diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c
index 352999c..c7bcc49 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -4018,8 +4018,7 @@ bool BKE_object_modifier_use_time(Object *ob, ModifierData *md)
 		FCurve *fcu;
 
 		char pattern[MAX_NAME + 10];
-		/* TODO(sergey): Escape modifier name. */
-		BLI_snprintf(pattern, sizeof(pattern), "modifiers[%s", md->name);
+		BLI_snprintf(pattern, sizeof(pattern), "modifiers[\"%s\"]", md->name);
 
 		/* action - check for F-Curves with paths containing 'modifiers[' */
 		if (adt->action) {
diff --git a/source/blender/depsgraph/intern/depsgraph_build_relations.cc b/source/blender/depsgraph/intern/depsgraph_build_relations.cc
index 9bd448a..649105a 100644
--- a/source/blender/depsgraph/intern/depsgraph_build_relations.cc
+++ b/source/blender/depsgraph/intern/depsgraph_build_relations.cc
@@ -1576,6 +1576,17 @@ void DepsgraphRelationBuilder::build_obdata_geom(Main *bmain, Scene *scene, Obje
 			if (BKE_object_modifier_use_time(ob, md)) {
 				TimeSourceKey time_src_key;
 				add_relation(time_src_key, mod_key, DEPSREL_TYPE_TIME, "Time Source");
+				
+				/* Hacky fix for T45633 (Animated modifiers aren't updated)
+				 *
+				 * This check works because BKE_object_modifier_use_time() tests
+				 * for either the modifier needing time, or that it is animated.
+				 */
+				/* XXX: Remove this hack when these links are added as part of build_animdata() instead */
+				if (modifier_dependsOnTime(md) == false) {
+					ComponentKey animation_key(&ob->id, DEPSNODE_TYPE_ANIMATION);
+					add_relation(animation_key, mod_key, DEPSREL_TYPE_OPERATION, "Modifier Animation");
+				}
 			}
 
 			prev_mod_key = mod_key;




More information about the Bf-blender-cvs mailing list