From 334b55fd2e89d66023a499e1ce7f867d9789290d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Tue, 1 May 2018 17:33:04 +0200 Subject: 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. --- source/blender/modifiers/intern/MOD_uvwarp.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'source/blender/modifiers/intern/MOD_uvwarp.c') diff --git a/source/blender/modifiers/intern/MOD_uvwarp.c b/source/blender/modifiers/intern/MOD_uvwarp.c index 09e46748127..7ea2d6ad3b3 100644 --- a/source/blender/modifiers/intern/MOD_uvwarp.c +++ b/source/blender/modifiers/intern/MOD_uvwarp.c @@ -146,9 +146,8 @@ static void uv_warp_compute( } } -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) { UVWarpModifierData *umd = (UVWarpModifierData *) md; int numPolys, numLoops; @@ -206,7 +205,7 @@ static DerivedMesh *applyModifier(ModifierData *md, struct Depsgraph *UNUSED(dep mloop = dm->getLoopArray(dm); /* make sure we are not modifying the original UV map */ mloopuv = CustomData_duplicate_referenced_layer_named(&dm->loopData, CD_MLOOPUV, uvname, numLoops); - modifier_get_vgroup(ob, dm, umd->vgroup_name, &dvert, &defgrp_index); + modifier_get_vgroup(ctx->object, dm, umd->vgroup_name, &dvert, &defgrp_index); UVWarpData data = {.mpoly = mpoly, .mloop = mloop, .mloopuv = mloopuv, .dvert = dvert, .defgrp_index = defgrp_index, -- cgit v1.2.3