From 72cbf966fb9194edbe6fa82cfd02540dc306184a Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Fri, 20 Jul 2018 15:13:48 +0200 Subject: Depsgraph: Fix missing relation from proxy_form's ID properties Hopefully this will fix issue with camera rig where camera properties (like, near/far clip) are driven by custom properties from bones, and those bones are actually belong to proxied armature. --- .../blender/depsgraph/intern/builder/deg_builder_nodes.cc | 11 +++++++++++ .../depsgraph/intern/builder/deg_builder_relations.cc | 15 +++++++++++++++ 2 files changed, 26 insertions(+) (limited to 'source/blender') diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc index ab7ddb507a0..1b68a73bbd7 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc @@ -829,8 +829,19 @@ void DepsgraphNodeBuilder::build_driver_variables(ID * id, FCurve *fcurve) LISTBASE_FOREACH (DriverVar *, dvar, &fcurve->driver->variables) { DRIVER_TARGETS_USED_LOOPER(dvar) { + if (dtar->id == NULL) { + continue; + } build_id(dtar->id); build_driver_id_property(dtar->id, dtar->rna_path); + /* Corresponds to dtar_id_ensure_proxy_from(). */ + if ((GS(dtar->id->name) == ID_OB) && + (((Object *)dtar->id)->proxy_from != NULL)) + { + Object *proxy_from = ((Object *)dtar->id)->proxy_from; + build_id(&proxy_from->id); + build_driver_id_property(&proxy_from->id, dtar->rna_path); + } } DRIVER_TARGETS_LOOPER_END } diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc index bba1ba67962..1a0c621ab43 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc @@ -1351,6 +1351,14 @@ void DepsgraphRelationBuilder::build_driver_variables(ID *id, FCurve *fcu) continue; } build_id(dtar->id); + /* Initialize relations coming to proxy_from. */ + Object *proxy_from = NULL; + if ((GS(dtar->id->name) == ID_OB) && + (((Object *)dtar->id)->proxy_from != NULL)) + { + proxy_from = ((Object *)dtar->id)->proxy_from; + build_id(&proxy_from->id); + } /* Special handling for directly-named bones. */ if ((dtar->flag & DTAR_FLAG_STRUCT_REF) && (((Object *)dtar->id)->type == OB_ARMATURE) && @@ -1398,6 +1406,13 @@ void DepsgraphRelationBuilder::build_driver_variables(ID *id, FCurve *fcu) continue; } add_relation(variable_key, driver_key, "RNA Target -> Driver"); + if (proxy_from != NULL) { + RNAPathKey proxy_from_variable_key(&proxy_from->id, + dtar->rna_path); + add_relation(proxy_from_variable_key, + variable_key, + "Proxy From -> Variable"); + } } else { if (dtar->id == id) { -- cgit v1.2.3