diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-12-05 12:14:12 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-12-06 12:21:33 +0300 |
commit | 335343fe93a9d96d293011ff263495be37ec2a62 (patch) | |
tree | 302e4610ecccb6c3fff4ef7608be7575515bbe36 /source/blender/depsgraph | |
parent | f1ad6b43b316b4f6da2937f11a7aca4302a86dc8 (diff) |
Fix T53408: Updating Cycles Nodes via Drivers in Material View
This is something what should be supported by the new dependency graph.
Fixed by making it so, build_animation() adds relation between Animation
component and whatever-is-being-animated. In fact, for now, only relations to
ID properties are added. Rest of the relations are kind of hacked in all over
the code and needs to be removed and verified with specific .blend files.
Diffstat (limited to 'source/blender/depsgraph')
-rw-r--r-- | source/blender/depsgraph/intern/builder/deg_builder_relations.cc | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc index 58d80dc9553..083f0126caa 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc @@ -890,6 +890,28 @@ void DepsgraphRelationBuilder::build_animdata_curves(ID *id) /* Wire up dependency to time source. */ TimeSourceKey time_src_key; add_relation(time_src_key, adt_key, "TimeSrc -> Animation"); + /* Build dependencies from FCurve to a "target" which is modified by + * the curve. + */ + if (adt->action != NULL) { + 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"); + } + } + } } void DepsgraphRelationBuilder::build_animdata_drievrs(ID *id) |