From b88d8916e44f998c4f0bc397b29b0d6ff0f011e9 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Sun, 23 Aug 2015 22:12:25 +1200 Subject: 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. --- source/blender/blenkernel/intern/object.c | 3 +-- source/blender/depsgraph/intern/depsgraph_build_relations.cc | 11 +++++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index 352999c96da..c7bcc499985 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 9bd448aa51c..649105a0df2 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; -- cgit v1.2.3