From abc55bf84a236f3e591d34a480a6fe0f8d3c7688 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Tue, 5 Dec 2017 12:57:01 +0100 Subject: [PATCH] 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. --- .../intern/builder/deg_builder_relations.cc | 22 +++++-------------- 1 file changed, 5 insertions(+), 17 deletions(-) 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); } } }