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_build.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_build.c')
-rw-r--r-- | source/blender/modifiers/intern/MOD_build.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/source/blender/modifiers/intern/MOD_build.c b/source/blender/modifiers/intern/MOD_build.c index 26895e0f3ad..aebf63c3100 100644 --- a/source/blender/modifiers/intern/MOD_build.c +++ b/source/blender/modifiers/intern/MOD_build.c @@ -80,9 +80,8 @@ static bool dependsOnTime(ModifierData *UNUSED(md)) return true; } -static Mesh *applyModifier(ModifierData *md, struct Depsgraph *depsgraph, - Object *UNUSED(ob), struct Mesh *mesh, - ModifierApplyFlag UNUSED(flag)) +static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx, + struct Mesh *mesh) { Mesh *result; BuildModifierData *bmd = (BuildModifierData *) md; @@ -116,7 +115,7 @@ static Mesh *applyModifier(ModifierData *md, struct Depsgraph *depsgraph, range_vn_i(edgeMap, numEdge_src, 0); range_vn_i(faceMap, numPoly_src, 0); - struct Scene *scene = DEG_get_input_scene(depsgraph); + struct Scene *scene = DEG_get_input_scene(ctx->depsgraph); frac = (BKE_scene_frame_get(scene) - bmd->start) / bmd->length; CLAMP(frac, 0.0f, 1.0f); if (bmd->flag & MOD_BUILD_FLAG_REVERSE) { |