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.
This commit is contained in:
Joshua Leung 2015-08-23 22:12:25 +12:00
parent e7775833a7
commit b88d8916e4
2 changed files with 12 additions and 2 deletions

View File

@ -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) {

View File

@ -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;