diff options
author | Sybren A. Stüvel <sybren@stuvel.eu> | 2018-05-01 18:33:04 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@stuvel.eu> | 2018-05-01 19:02:17 +0300 |
commit | 334b55fd2e89d66023a499e1ce7f867d9789290d (patch) | |
tree | 3afcc711d6a9eeda85d9ae069ce1ac9cfc9fcb89 /source/blender/modifiers/intern/MOD_meshsequencecache.c | |
parent | 6b9f1ffe6e56ee4d55f4cde5c724c31a3a90292b (diff) |
Extract common modifier parameters into ModifierEvalContext struct
The contents of the ModifierEvalContext struct are constant while iterating
over the modifier stack. The struct thus should be only created once, outside
any loop over the modifiers.
Diffstat (limited to 'source/blender/modifiers/intern/MOD_meshsequencecache.c')
-rw-r--r-- | source/blender/modifiers/intern/MOD_meshsequencecache.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/source/blender/modifiers/intern/MOD_meshsequencecache.c b/source/blender/modifiers/intern/MOD_meshsequencecache.c index e95148eb6b2..8ca5873f85c 100644 --- a/source/blender/modifiers/intern/MOD_meshsequencecache.c +++ b/source/blender/modifiers/intern/MOD_meshsequencecache.c @@ -90,15 +90,14 @@ static bool isDisabled(ModifierData *md, int UNUSED(useRenderParams)) return (mcmd->cache_file == NULL) || (mcmd->object_path[0] == '\0'); } -static DerivedMesh *applyModifier(ModifierData *md, struct Depsgraph *UNUSED(depsgraph), - Object *ob, DerivedMesh *dm, - ModifierApplyFlag UNUSED(flag)) +static DerivedMesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx, + DerivedMesh *dm) { #ifdef WITH_ALEMBIC MeshSeqCacheModifierData *mcmd = (MeshSeqCacheModifierData *) md; /* Only used to check whether we are operating on org data or not... */ - Mesh *me = (ob->type == OB_MESH) ? ob->data : NULL; + Mesh *me = (ctx->object->type == OB_MESH) ? ctx->object->data : NULL; DerivedMesh *org_dm = dm; Scene *scene = md->scene; @@ -113,7 +112,7 @@ static DerivedMesh *applyModifier(ModifierData *md, struct Depsgraph *UNUSED(dep if (!mcmd->reader) { mcmd->reader = CacheReader_open_alembic_object(cache_file->handle, NULL, - ob, + ctx->object, mcmd->object_path); if (!mcmd->reader) { modifier_setError(md, "Could not create Alembic reader for file %s", cache_file->filepath); @@ -132,7 +131,7 @@ static DerivedMesh *applyModifier(ModifierData *md, struct Depsgraph *UNUSED(dep } DerivedMesh *result = ABC_read_mesh(mcmd->reader, - ob, + ctx->object, dm, time, &err_str, @@ -150,7 +149,7 @@ static DerivedMesh *applyModifier(ModifierData *md, struct Depsgraph *UNUSED(dep return result ? result : dm; #else return dm; - UNUSED_VARS(md, ob); + UNUSED_VARS(ctx, md); #endif } |