[Bf-blender-cvs] [00bfca2] master: Fix T45241: New depsgraph was lacking update of python drivers on time change

Sergey Sharybin noreply at git.blender.org
Tue Jun 30 17:36:21 CEST 2015


Commit: 00bfca21780f69428ce042ca2a06524b6daf6c31
Author: Sergey Sharybin
Date:   Tue Jun 30 17:34:57 2015 +0200
Branches: master
https://developer.blender.org/rB00bfca21780f69428ce042ca2a06524b6daf6c31

Fix T45241: New depsgraph was lacking update of python drivers on time change

It's quite tricky to see if the driver actually depends on time or not,
so currently used approach when we'll be doing some extra updates.

This seems to correspond to how old depsgraph was dealing with this.

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

M	source/blender/depsgraph/intern/depsgraph_build_relations.cc
M	source/blender/modifiers/intern/MOD_mirror.c

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

diff --git a/source/blender/depsgraph/intern/depsgraph_build_relations.cc b/source/blender/depsgraph/intern/depsgraph_build_relations.cc
index 2453701..8ee113e 100644
--- a/source/blender/depsgraph/intern/depsgraph_build_relations.cc
+++ b/source/blender/depsgraph/intern/depsgraph_build_relations.cc
@@ -892,6 +892,15 @@ void DepsgraphRelationBuilder::build_driver(ID *id, FCurve *fcu)
 		}
 		DRIVER_TARGETS_LOOPER_END
 	}
+
+	/* It's quite tricky to detect if the driver actually depends on time or not,
+	 * so for now we'll be quite conservative here about optimization and consider
+	 * all python drivers to be depending on time.
+	 */
+	if (driver->type == DRIVER_TYPE_PYTHON) {
+		TimeSourceKey time_src_key;
+		add_relation(time_src_key, driver_key, DEPSREL_TYPE_TIME, "[TimeSrc -> Driver]");
+	}
 }
 
 void DepsgraphRelationBuilder::build_world(World *world)
diff --git a/source/blender/modifiers/intern/MOD_mirror.c b/source/blender/modifiers/intern/MOD_mirror.c
index d3080ca..cc02d84 100644
--- a/source/blender/modifiers/intern/MOD_mirror.c
+++ b/source/blender/modifiers/intern/MOD_mirror.c
@@ -93,13 +93,14 @@ static void updateDepgraph(ModifierData *md, DagForest *forest,
 static void updateDepsgraph(ModifierData *md,
                             struct Main *UNUSED(bmain),
                             struct Scene *UNUSED(scene),
-                            Object *UNUSED(ob),
+                            Object *ob,
                             struct DepsNodeHandle *node)
 {
 	MirrorModifierData *mmd = (MirrorModifierData *)md;
 	if (mmd->mirror_ob != NULL) {
 		DEG_add_object_relation(node, mmd->mirror_ob, DEG_OB_COMP_TRANSFORM, "Mirror Modifier");
 	}
+	DEG_add_object_relation(node, ob, DEG_OB_COMP_TRANSFORM, "Mirror Modifier");
 }
 
 static DerivedMesh *doMirrorOnAxis(MirrorModifierData *mmd,




More information about the Bf-blender-cvs mailing list