[Bf-blender-cvs] [72cbf966fb9] blender2.8: Depsgraph: Fix missing relation from proxy_form's ID properties

Sergey Sharybin noreply at git.blender.org
Fri Jul 20 15:15:18 CEST 2018


Commit: 72cbf966fb9194edbe6fa82cfd02540dc306184a
Author: Sergey Sharybin
Date:   Fri Jul 20 15:13:48 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB72cbf966fb9194edbe6fa82cfd02540dc306184a

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.

===================================================================

M	source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
M	source/blender/depsgraph/intern/builder/deg_builder_relations.cc

===================================================================

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



More information about the Bf-blender-cvs mailing list