From fd0bc7e002ced8ffd85e9aa3edcae173dbd13392 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Tue, 28 Jan 2020 16:15:40 +0100 Subject: Fix T72660: Alembic caches are not properly updated by drivers Drivers were not considered when building the dependency graph for `CacheFile` datablocks. --- .../depsgraph/intern/builder/deg_builder_relations.cc | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to '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 fa7a63227f5..712d9d23128 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc @@ -200,6 +200,15 @@ bool check_id_has_anim_component(ID *id) return (adt->action != NULL) || (!BLI_listbase_is_empty(&adt->nla_tracks)); } +bool check_id_has_driver_component(ID *id) +{ + AnimData *adt = BKE_animdata_from_id(id); + if (adt == nullptr) { + return false; + } + return !BLI_listbase_is_empty(&adt->drivers); +} + OperationCode bone_target_opcode(ID *target, const char *subtarget, ID *id, @@ -2358,8 +2367,9 @@ void DepsgraphRelationBuilder::build_cachefile(CacheFile *cache_file) /* Animation. */ build_animdata(&cache_file->id); build_parameters(&cache_file->id); - if (check_id_has_anim_component(&cache_file->id)) { - ComponentKey animation_key(&cache_file->id, NodeType::ANIMATION); + if (check_id_has_anim_component(&cache_file->id) || + check_id_has_driver_component(&cache_file->id)) { + ComponentKey animation_key(&cache_file->id, NodeType::PARAMETERS); ComponentKey datablock_key(&cache_file->id, NodeType::CACHE); add_relation(animation_key, datablock_key, "Datablock Animation"); } -- cgit v1.2.3