[Bf-blender-cvs] [335343fe93a] master: Fix T53408: Updating Cycles Nodes via Drivers in Material View
Sergey Sharybin
noreply at git.blender.org
Wed Dec 6 10:32:52 CET 2017
Commit: 335343fe93a9d96d293011ff263495be37ec2a62
Author: Sergey Sharybin
Date: Tue Dec 5 10:14:12 2017 +0100
Branches: master
https://developer.blender.org/rB335343fe93a9d96d293011ff263495be37ec2a62
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.
===================================================================
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 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)
More information about the Bf-blender-cvs
mailing list