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_solidify.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_solidify.c')
-rw-r--r--source/blender/modifiers/intern/MOD_solidify.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/source/blender/modifiers/intern/MOD_solidify.c b/source/blender/modifiers/intern/MOD_solidify.c
index 86a37dfbd2d..d947ba139ed 100644
--- a/source/blender/modifiers/intern/MOD_solidify.c
+++ b/source/blender/modifiers/intern/MOD_solidify.c
@@ -205,9 +205,8 @@ BLI_INLINE void madd_v3v3short_fl(float r[3], const short a[3], const float f)
}
static DerivedMesh *applyModifier(
- ModifierData *md, struct Depsgraph *UNUSED(depsgraph),
- Object *ob, DerivedMesh *dm,
- ModifierApplyFlag UNUSED(flag))
+ ModifierData *md, const ModifierEvalContext *ctx,
+ DerivedMesh *dm)
{
DerivedMesh *result;
const SolidifyModifierData *smd = (SolidifyModifierData *) md;
@@ -223,7 +222,7 @@ static DerivedMesh *applyModifier(
unsigned int newLoops = 0, newFaces = 0, newEdges = 0, newVerts = 0, rimVerts = 0;
/* only use material offsets if we have 2 or more materials */
- const short mat_nr_max = ob->totcol > 1 ? ob->totcol - 1 : 0;
+ const short mat_nr_max = ctx->object->totcol > 1 ? ctx->object->totcol - 1 : 0;
const short mat_ofs = mat_nr_max ? smd->mat_ofs : 0;
const short mat_ofs_rim = mat_nr_max ? smd->mat_ofs_rim : 0;
@@ -261,7 +260,7 @@ static DerivedMesh *applyModifier(
/* array size is doubled in case of using a shell */
const unsigned int stride = do_shell ? 2 : 1;
- modifier_get_vgroup(ob, dm, smd->defgrp_name, &dvert, &defgrp_index);
+ modifier_get_vgroup(ctx->object, dm, smd->defgrp_name, &dvert, &defgrp_index);
orig_mvert = dm->getVertArray(dm);
orig_medge = dm->getEdgeArray(dm);