Depsgraph: Wrap all arguments foe modifiers relations update into a struct

Makes it easier to add or remove fields needed to update relations.
This commit is contained in:
2018-02-22 12:54:06 +01:00
parent 93072e44d1
commit df04520602
34 changed files with 251 additions and 479 deletions

View File

@@ -174,36 +174,25 @@ static void foreachIDLink(ModifierData *md, Object *ob,
}
static void updateDepgraph(ModifierData *md, DagForest *forest,
struct Main *bmain,
struct Scene *scene,
Object *ob, DagNode *obNode)
static void updateDepgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx)
{
MeshSeqCacheModifierData *mcmd = (MeshSeqCacheModifierData *) md;
if (mcmd->cache_file != NULL) {
DagNode *curNode = dag_get_node(forest, mcmd->cache_file);
DagNode *curNode = dag_get_node(ctx->forest, mcmd->cache_file);
dag_add_relation(forest, curNode, obNode,
dag_add_relation(ctx->forest, curNode, ctx->obNode,
DAG_RL_DATA_DATA | DAG_RL_OB_DATA, "Cache File Modifier");
}
UNUSED_VARS(bmain, scene, ob);
}
static void updateDepsgraph(ModifierData *md,
struct Main *bmain,
struct Scene *scene,
Object *ob,
struct DepsNodeHandle *node)
static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx)
{
MeshSeqCacheModifierData *mcmd = (MeshSeqCacheModifierData *) md;
if (mcmd->cache_file != NULL) {
DEG_add_object_cache_relation(node, mcmd->cache_file, DEG_OB_COMP_CACHE, "Mesh Cache File");
DEG_add_object_cache_relation(ctx->node, mcmd->cache_file, DEG_OB_COMP_CACHE, "Mesh Cache File");
}
UNUSED_VARS(bmain, scene, ob);
}
ModifierTypeInfo modifierType_MeshSequenceCache = {