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.
This commit is contained in:
2015-06-30 17:34:57 +02:00
parent c1d6a26842
commit 00bfca2178
2 changed files with 11 additions and 1 deletions

View File

@@ -892,6 +892,15 @@ void DepsgraphRelationBuilder::build_driver(ID *id, FCurve *fcu)
} }
DRIVER_TARGETS_LOOPER_END 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) void DepsgraphRelationBuilder::build_world(World *world)

View File

@@ -93,13 +93,14 @@ static void updateDepgraph(ModifierData *md, DagForest *forest,
static void updateDepsgraph(ModifierData *md, static void updateDepsgraph(ModifierData *md,
struct Main *UNUSED(bmain), struct Main *UNUSED(bmain),
struct Scene *UNUSED(scene), struct Scene *UNUSED(scene),
Object *UNUSED(ob), Object *ob,
struct DepsNodeHandle *node) struct DepsNodeHandle *node)
{ {
MirrorModifierData *mmd = (MirrorModifierData *)md; MirrorModifierData *mmd = (MirrorModifierData *)md;
if (mmd->mirror_ob != NULL) { if (mmd->mirror_ob != NULL) {
DEG_add_object_relation(node, mmd->mirror_ob, DEG_OB_COMP_TRANSFORM, "Mirror Modifier"); 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, static DerivedMesh *doMirrorOnAxis(MirrorModifierData *mmd,