[Bf-blender-cvs] [abc55bf84a2] master: Depsgraph: Use build_animation() to build relations to animated properties

Sergey Sharybin noreply at git.blender.org
Wed Dec 6 10:32:59 CET 2017


Commit: abc55bf84a236f3e591d34a480a6fe0f8d3c7688
Author: Sergey Sharybin
Date:   Tue Dec 5 12:57:01 2017 +0100
Branches: master
https://developer.blender.org/rBabc55bf84a236f3e591d34a480a6fe0f8d3c7688

Depsgraph: Use build_animation() to build relations to animated properties

Before that it was up to lots of other places to keep track on whether
something is to be dependent on time or not. Was annoying, and unreliable,
and fragile.

This commit avoids hacks in object builder. Other areas will be adopted
soon.

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

M	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 c1570f310ef..54d3259bc0f 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
@@ -486,11 +486,6 @@ void DepsgraphRelationBuilder::build_object(Object *object)
 	}
 	/* Animation data */
 	build_animdata(&object->id);
-	// XXX: This should be hooked up by the build_animdata code
-	if (needs_animdata_node(&object->id)) {
-		ComponentKey adt_key(&object->id, DEG_NODE_TYPE_ANIMATION);
-		add_relation(adt_key, local_transform_key, "Object Animation");
-	}
 	/* Object data. */
 	build_object_data(object);
 	/* Particle systems. */
@@ -899,19 +894,12 @@ void DepsgraphRelationBuilder::build_animdata_curves(ID *id)
 		PointerRNA id_ptr;
 		RNA_id_pointer_create(id, &id_ptr);
 		LINKLIST_FOREACH(FCurve *, fcu, &adt->action->curves) {
-			PointerRNA ptr;
-			PropertyRNA *prop;
-			int index;
-			if (!RNA_path_resolve_full(&id_ptr, fcu->rna_path,
-			                           &ptr, &prop, &index))
-			{
-				continue;
-			}
 			/* TODO(sergey): Avoid duplicated relations. */
-			if (prop != NULL && RNA_property_is_idprop(prop)) {
-				RNAPathKey prop_key(id, fcu->rna_path);
-				add_relation(adt_key, prop_key, "Animation -> ID Prop");
-			}
+			/* TODO(sergey): FCurve on a bone should be hooking up to pose
+			 * init rather than to bone local.
+			 */
+			RNAPathKey prop_key(id, fcu->rna_path);
+			add_relation(adt_key, prop_key, "Animation -> Prop", true);
 		}
 	}
 }



More information about the Bf-blender-cvs mailing list