Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSybren A. Stüvel <sybren@stuvel.eu>2018-05-01 18:33:04 +0300
committerSybren A. Stüvel <sybren@stuvel.eu>2018-05-01 19:02:17 +0300
commit334b55fd2e89d66023a499e1ce7f867d9789290d (patch)
tree3afcc711d6a9eeda85d9ae069ce1ac9cfc9fcb89 /source/blender/modifiers/intern/MOD_screw.c
parent6b9f1ffe6e56ee4d55f4cde5c724c31a3a90292b (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_screw.c')
-rw-r--r--source/blender/modifiers/intern/MOD_screw.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/source/blender/modifiers/intern/MOD_screw.c b/source/blender/modifiers/intern/MOD_screw.c
index e53d11d9b01..6335c453955 100644
--- a/source/blender/modifiers/intern/MOD_screw.c
+++ b/source/blender/modifiers/intern/MOD_screw.c
@@ -184,14 +184,13 @@ static void copyData(ModifierData *md, ModifierData *target)
modifier_copyData_generic(md, target);
}
-static DerivedMesh *applyModifier(ModifierData *md, struct Depsgraph *UNUSED(depsgraph),
- Object *ob, DerivedMesh *derivedData,
- ModifierApplyFlag flag)
+static DerivedMesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx,
+ DerivedMesh *derivedData)
{
DerivedMesh *dm = derivedData;
DerivedMesh *result;
ScrewModifierData *ltmd = (ScrewModifierData *) md;
- const bool use_render_params = (flag & MOD_APPLY_RENDER) != 0;
+ const bool use_render_params = (ctx->flag & MOD_APPLY_RENDER) != 0;
int *origindex;
int mpoly_index = 0;
@@ -279,7 +278,7 @@ static DerivedMesh *applyModifier(ModifierData *md, struct Depsgraph *UNUSED(dep
if (ltmd->ob_axis) {
/* calc the matrix relative to the axis object */
- invert_m4_m4(mtx_tmp_a, ob->obmat);
+ invert_m4_m4(mtx_tmp_a, ctx->object->obmat);
copy_m4_m4(mtx_tx_inv, ltmd->ob_axis->obmat);
mul_m4_m4m4(mtx_tx, mtx_tmp_a, mtx_tx_inv);