diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-07-20 16:13:48 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-07-20 16:15:12 +0300 |
commit | 72cbf966fb9194edbe6fa82cfd02540dc306184a (patch) | |
tree | c51a6565038011ad0c6d67d81f61b159d46a04a3 /source/blender | |
parent | 4a79b46b9c7a7800e7e333163e6e4d3f30285d28 (diff) |
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.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/depsgraph/intern/builder/deg_builder_nodes.cc | 11 | ||||
-rw-r--r-- | source/blender/depsgraph/intern/builder/deg_builder_relations.cc | 15 |
2 files changed, 26 insertions, 0 deletions
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) { |