diff --git a/source/blender/blenkernel/BKE_modifier.h b/source/blender/blenkernel/BKE_modifier.h index b4320b7025a..db57d411f31 100644 --- a/source/blender/blenkernel/BKE_modifier.h +++ b/source/blender/blenkernel/BKE_modifier.h @@ -109,6 +109,12 @@ typedef void (*ObjectWalkFunc)(void *userData, struct Object *ob, struct Object typedef void (*IDWalkFunc)(void *userData, struct Object *ob, struct ID **idpoin); typedef void (*TexWalkFunc)(void *userData, struct Object *ob, struct ModifierData *md, const char *propname); +typedef enum ModifierApplyFlag { + MOD_APPLY_RENDER = 1 << 0, /* Render time. */ + MOD_APPLY_USECACHE = 1 << 1, /* Last modifier in stack. */ +} ModifierApplyFlag; + + typedef struct ModifierTypeInfo { /* The user visible name for this modifier */ char name[32]; @@ -142,7 +148,7 @@ typedef struct ModifierTypeInfo { void (*deformVerts)(struct ModifierData *md, struct Object *ob, struct DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts, - int useRenderParams, int isFinalCalc); + ModifierApplyFlag flag); /* Like deformMatricesEM but called from object mode (for supporting modifiers in sculpt mode) */ void (*deformMatrices)( @@ -187,7 +193,7 @@ typedef struct ModifierTypeInfo { struct DerivedMesh *(*applyModifier)( struct ModifierData *md, struct Object *ob, struct DerivedMesh *derivedData, - int useRenderParams, int isFinalCalc); + ModifierApplyFlag flag); /* Like applyModifier but called during editmode (for supporting * modifiers). diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c index e74a412420c..50c10ea3c3d 100644 --- a/source/blender/blenkernel/intern/DerivedMesh.c +++ b/source/blender/blenkernel/intern/DerivedMesh.c @@ -814,7 +814,7 @@ DerivedMesh *mesh_create_derived_for_modifier(Scene *scene, Object *ob, int numVerts; float (*deformedVerts)[3] = mesh_getVertexCos(me, &numVerts); - mti->deformVerts(md, ob, NULL, deformedVerts, numVerts, 0, 0); + mti->deformVerts(md, ob, NULL, deformedVerts, numVerts, 0); dm = mesh_create_derived(me, ob, deformedVerts); if (build_shapekey_layers) @@ -828,7 +828,7 @@ DerivedMesh *mesh_create_derived_for_modifier(Scene *scene, Object *ob, if (build_shapekey_layers) add_shapekey_layers(tdm, me, ob); - dm = mti->applyModifier(md, ob, tdm, 0, 0); + dm = mti->applyModifier(md, ob, tdm, 0); if (tdm != dm) tdm->release(tdm); } @@ -1383,6 +1383,13 @@ static void mesh_calc_modifiers(Scene *scene, Object *ob, float (*inputVertexCos /* XXX Same as above... For now, only weights preview in WPaint mode. */ const int do_mod_wmcol = do_init_wmcol; + ModifierApplyFlag app_flags = useRenderParams ? MOD_APPLY_RENDER : 0; + ModifierApplyFlag deform_app_flags = app_flags; + if (useCache) + app_flags |= MOD_APPLY_USECACHE; + if (useDeform) + deform_app_flags |= MOD_APPLY_USECACHE; + if (mmd && !mmd->sculptlvl) has_multires = 0; @@ -1434,7 +1441,7 @@ static void mesh_calc_modifiers(Scene *scene, Object *ob, float (*inputVertexCos if (!deformedVerts) deformedVerts = mesh_getVertexCos(me, &numVerts); - mti->deformVerts(md, ob, NULL, deformedVerts, numVerts, useRenderParams, useDeform); + mti->deformVerts(md, ob, NULL, deformedVerts, numVerts, deform_app_flags); } else { break; @@ -1547,7 +1554,7 @@ static void mesh_calc_modifiers(Scene *scene, Object *ob, float (*inputVertexCos } } - mti->deformVerts(md, ob, dm, deformedVerts, numVerts, useRenderParams, useDeform); + mti->deformVerts(md, ob, dm, deformedVerts, numVerts, deform_app_flags); } else { DerivedMesh *ndm; @@ -1622,7 +1629,7 @@ static void mesh_calc_modifiers(Scene *scene, Object *ob, float (*inputVertexCos } } - ndm = mti->applyModifier(md, ob, dm, useRenderParams, useCache); + ndm = mti->applyModifier(md, ob, dm, app_flags); if (ndm) { /* if the modifier returned a new dm, release the old one */ @@ -1645,7 +1652,7 @@ static void mesh_calc_modifiers(Scene *scene, Object *ob, float (*inputVertexCos nextmask &= ~CD_MASK_ORCO; DM_set_only_copy(orcodm, nextmask | CD_MASK_ORIGINDEX); - ndm = mti->applyModifier(md, ob, orcodm, useRenderParams, 0); + ndm = mti->applyModifier(md, ob, orcodm, app_flags & ~MOD_APPLY_USECACHE); if (ndm) { /* if the modifier returned a new dm, release the old one */ @@ -1661,7 +1668,7 @@ static void mesh_calc_modifiers(Scene *scene, Object *ob, float (*inputVertexCos nextmask &= ~CD_MASK_CLOTH_ORCO; DM_set_only_copy(clothorcodm, nextmask | CD_MASK_ORIGINDEX); - ndm = mti->applyModifier(md, ob, clothorcodm, useRenderParams, 0); + ndm = mti->applyModifier(md, ob, clothorcodm, app_flags & ~MOD_APPLY_USECACHE); if (ndm) { /* if the modifier returned a new dm, release the old one */ @@ -1928,7 +1935,8 @@ static void editbmesh_calc_modifiers(Scene *scene, Object *ob, BMEditMesh *em, D if (mti->deformVertsEM) mti->deformVertsEM(md, ob, em, dm, deformedVerts, numVerts); - else mti->deformVerts(md, ob, dm, deformedVerts, numVerts, 0, 0); + else + mti->deformVerts(md, ob, dm, deformedVerts, numVerts, 0); } else { DerivedMesh *ndm; @@ -1971,7 +1979,7 @@ static void editbmesh_calc_modifiers(Scene *scene, Object *ob, BMEditMesh *em, D if (mti->applyModifierEM) ndm = mti->applyModifierEM(md, ob, em, orcodm); else - ndm = mti->applyModifier(md, ob, orcodm, 0, 0); + ndm = mti->applyModifier(md, ob, orcodm, 0); if (ndm) { /* if the modifier returned a new dm, release the old one */ @@ -1995,7 +2003,7 @@ static void editbmesh_calc_modifiers(Scene *scene, Object *ob, BMEditMesh *em, D if (mti->applyModifierEM) ndm = mti->applyModifierEM(md, ob, em, dm); else - ndm = mti->applyModifier(md, ob, dm, 0, 0); + ndm = mti->applyModifier(md, ob, dm, 0); if (ndm) { if (dm && dm != ndm) diff --git a/source/blender/blenkernel/intern/displist.c b/source/blender/blenkernel/intern/displist.c index a3f5c5c23c6..29aab8b3eb6 100644 --- a/source/blender/blenkernel/intern/displist.c +++ b/source/blender/blenkernel/intern/displist.c @@ -752,14 +752,19 @@ static void curve_calc_modifiers_pre(Scene *scene, Object *ob, int forRender, fl Curve *cu = ob->data; ListBase *nurb = BKE_curve_nurbs_get(cu); int numVerts = 0; - int editmode = (!forRender && cu->editnurb); + const int editmode = (!forRender && cu->editnurb); + ModifierApplyFlag app_flag = 0; float (*originalVerts)[3] = NULL; float (*deformedVerts)[3] = NULL; float *keyVerts = NULL; int required_mode; - if (forRender) + if (editmode) + app_flag |= MOD_APPLY_USECACHE; + if (forRender) { + app_flag |= MOD_APPLY_RENDER; required_mode = eModifierMode_Render; + } else required_mode = eModifierMode_Realtime; @@ -800,7 +805,7 @@ static void curve_calc_modifiers_pre(Scene *scene, Object *ob, int forRender, fl originalVerts = MEM_dupallocN(deformedVerts); } - mti->deformVerts(md, ob, NULL, deformedVerts, numVerts, forRender, editmode); + mti->deformVerts(md, ob, NULL, deformedVerts, numVerts, app_flag); if (md == pretessellatePoint) break; @@ -866,9 +871,12 @@ static void curve_calc_modifiers_post(Scene *scene, Object *ob, ListBase *dispba DerivedMesh *dm = NULL, *ndm; float (*vertCos)[3] = NULL; int useCache = !forRender; + ModifierApplyFlag app_flag = 0; - if (forRender) + if (forRender) { + app_flag |= MOD_APPLY_RENDER; required_mode = eModifierMode_Render; + } else required_mode = eModifierMode_Realtime; @@ -887,6 +895,7 @@ static void curve_calc_modifiers_post(Scene *scene, Object *ob, ListBase *dispba for (; md; md = md->next) { ModifierTypeInfo *mti = modifierType_getInfo(md->type); + ModifierApplyFlag appf = app_flag; md->scene = scene; @@ -897,6 +906,8 @@ static void curve_calc_modifiers_post(Scene *scene, Object *ob, ListBase *dispba if (mti->type == eModifierTypeType_OnlyDeform || (mti->type == eModifierTypeType_DeformOrConstruct && !dm)) { + if (editmode) + appf |= MOD_APPLY_USECACHE; if (dm) { if (!vertCos) { totvert = dm->getNumVerts(dm); @@ -904,14 +915,14 @@ static void curve_calc_modifiers_post(Scene *scene, Object *ob, ListBase *dispba dm->getVertCos(dm, vertCos); } - mti->deformVerts(md, ob, dm, vertCos, totvert, forRender, editmode); + mti->deformVerts(md, ob, dm, vertCos, totvert, appf); } else { if (!vertCos) { vertCos = displist_get_allverts(dispbase, &totvert); } - mti->deformVerts(md, ob, NULL, vertCos, totvert, forRender, editmode); + mti->deformVerts(md, ob, NULL, vertCos, totvert, appf); } } else { @@ -953,7 +964,9 @@ static void curve_calc_modifiers_post(Scene *scene, Object *ob, ListBase *dispba vertCos = NULL; } - ndm = mti->applyModifier(md, ob, dm, forRender, useCache); + if (useCache) + appf |= MOD_APPLY_USECACHE; + ndm = mti->applyModifier(md, ob, dm, appf); if (ndm) { /* Modifier returned a new derived mesh */ @@ -1084,6 +1097,7 @@ static void curve_calc_orcodm(Scene *scene, Object *ob, DerivedMesh *derivedFina int required_mode; int editmode = (!forRender && cu->editnurb); DerivedMesh *ndm, *orcodm = NULL; + const ModifierApplyFlag app_flag = forRender ? MOD_APPLY_RENDER : 0; if (forRender) required_mode = eModifierMode_Render; @@ -1114,7 +1128,7 @@ static void curve_calc_orcodm(Scene *scene, Object *ob, DerivedMesh *derivedFina if (!orcodm) orcodm = create_orco_dm(scene, ob); - ndm = mti->applyModifier(md, ob, orcodm, forRender, 0); + ndm = mti->applyModifier(md, ob, orcodm, app_flag); if (ndm) { /* if the modifier returned a new dm, release the old one */ diff --git a/source/blender/blenkernel/intern/lattice.c b/source/blender/blenkernel/intern/lattice.c index 8ac8acf6edf..c6f2bb75858 100644 --- a/source/blender/blenkernel/intern/lattice.c +++ b/source/blender/blenkernel/intern/lattice.c @@ -976,7 +976,7 @@ void BKE_lattice_modifiers_calc(Scene *scene, Object *ob) if (mti->type != eModifierTypeType_OnlyDeform) continue; if (!vertexCos) vertexCos = BKE_lattice_vertexcos_get(ob, &numVerts); - mti->deformVerts(md, ob, NULL, vertexCos, numVerts, 0, 0); + mti->deformVerts(md, ob, NULL, vertexCos, numVerts, 0); } /* always displist to make this work like derivedmesh */ diff --git a/source/blender/blenkernel/intern/multires.c b/source/blender/blenkernel/intern/multires.c index bee1f534d05..026134609b7 100644 --- a/source/blender/blenkernel/intern/multires.c +++ b/source/blender/blenkernel/intern/multires.c @@ -279,7 +279,7 @@ DerivedMesh *get_multires_dm(Scene *scene, MultiresModifierData *mmd, Object *ob DerivedMesh *tdm = mesh_get_derived_deform(scene, ob, CD_MASK_BAREMESH); DerivedMesh *dm; - dm = mti->applyModifier(md, ob, tdm, 0, 1); + dm = mti->applyModifier(md, ob, tdm, MOD_APPLY_USECACHE); if (dm == tdm) { dm = CDDM_copy(tdm); } @@ -438,7 +438,7 @@ int multiresModifier_reshapeFromDeformMod(Scene *scene, MultiresModifierData *mm deformedVerts = MEM_callocN(sizeof(float) * numVerts * 3, "multiresReshape_deformVerts"); dm->getVertCos(dm, deformedVerts); - mti->deformVerts(md, ob, dm, deformedVerts, numVerts, 0, 0); + mti->deformVerts(md, ob, dm, deformedVerts, numVerts, 0); ndm = CDDM_copy(dm); CDDM_apply_vert_coords(ndm, deformedVerts); diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c index 17f4ea73d6d..4dd3688e877 100644 --- a/source/blender/editors/object/object_modifier.c +++ b/source/blender/editors/object/object_modifier.c @@ -545,7 +545,7 @@ static int modifier_apply_obdata(ReportList *reports, Scene *scene, Object *ob, BKE_report(reports, RPT_INFO, "Applied modifier only changed CV points, not tessellated/bevel vertices"); vertexCos = BKE_curve_vertexCos_get(cu, &cu->nurb, &numVerts); - mti->deformVerts(md, ob, NULL, vertexCos, numVerts, 0, 0); + mti->deformVerts(md, ob, NULL, vertexCos, numVerts, 0); BK_curve_vertexCos_apply(cu, &cu->nurb, vertexCos); MEM_freeN(vertexCos); diff --git a/source/blender/editors/util/crazyspace.c b/source/blender/editors/util/crazyspace.c index 5430a9a1c90..b0edc702e48 100644 --- a/source/blender/editors/util/crazyspace.c +++ b/source/blender/editors/util/crazyspace.c @@ -388,7 +388,7 @@ void crazyspace_build_sculpt(Scene *scene, Object *ob, float (**deformmats)[3][3 if (mti->deformMatrices && !deformed) continue; - mti->deformVerts(md, ob, NULL, deformedVerts, me->totvert, 0, 0); + mti->deformVerts(md, ob, NULL, deformedVerts, me->totvert, 0); deformed = 1; } } diff --git a/source/blender/modifiers/intern/MOD_armature.c b/source/blender/modifiers/intern/MOD_armature.c index ce4d726e072..e6d86de45b4 100644 --- a/source/blender/modifiers/intern/MOD_armature.c +++ b/source/blender/modifiers/intern/MOD_armature.c @@ -118,8 +118,7 @@ static void deformVerts(ModifierData *md, Object *ob, DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts, - int UNUSED(useRenderParams), - int UNUSED(isFinalCalc)) + ModifierApplyFlag UNUSED(flag)) { ArmatureModifierData *amd = (ArmatureModifierData *) md; diff --git a/source/blender/modifiers/intern/MOD_array.c b/source/blender/modifiers/intern/MOD_array.c index 36f668ca758..39e08c1cb5d 100644 --- a/source/blender/modifiers/intern/MOD_array.c +++ b/source/blender/modifiers/intern/MOD_array.c @@ -542,8 +542,7 @@ static DerivedMesh *arrayModifier_doArray(ArrayModifierData *amd, static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *dm, - int UNUSED(useRenderParams), - int UNUSED(isFinalCalc)) + ModifierApplyFlag UNUSED(flag)) { DerivedMesh *result; ArrayModifierData *amd = (ArrayModifierData *) md; @@ -560,7 +559,7 @@ static DerivedMesh *applyModifierEM(ModifierData *md, Object *ob, struct BMEditMesh *UNUSED(editData), DerivedMesh *dm) { - return applyModifier(md, ob, dm, 0, 1); + return applyModifier(md, ob, dm, MOD_APPLY_USECACHE); } diff --git a/source/blender/modifiers/intern/MOD_bevel.c b/source/blender/modifiers/intern/MOD_bevel.c index 042dd5c3f2b..6c91cd6e2d1 100644 --- a/source/blender/modifiers/intern/MOD_bevel.c +++ b/source/blender/modifiers/intern/MOD_bevel.c @@ -107,8 +107,7 @@ static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md) */ static DerivedMesh *applyModifier(ModifierData *md, struct Object *UNUSED(ob), DerivedMesh *dm, - int UNUSED(useRenderParams), - int UNUSED(isFinalCalc)) + ModifierApplyFlag UNUSED(flag)) { DerivedMesh *result; BMesh *bm; @@ -161,8 +160,7 @@ static DerivedMesh *applyModifier(ModifierData *md, struct Object *UNUSED(ob), static DerivedMesh *applyModifier(ModifierData *md, Object *UNUSED(ob), DerivedMesh *derivedData, - int UNUSED(useRenderParams), - int UNUSED(isFinalCalc)) + ModifierApplyFlag UNUSED(flag)) { DerivedMesh *result; BMEditMesh *em; @@ -202,7 +200,7 @@ static DerivedMesh *applyModifierEM(ModifierData *md, Object *ob, struct BMEditMesh *UNUSED(editData), DerivedMesh *derivedData) { - return applyModifier(md, ob, derivedData, 0, 1); + return applyModifier(md, ob, derivedData, MOD_APPLY_USECACHE); } diff --git a/source/blender/modifiers/intern/MOD_boolean.c b/source/blender/modifiers/intern/MOD_boolean.c index cf4605c3b40..6cd8745f5d9 100644 --- a/source/blender/modifiers/intern/MOD_boolean.c +++ b/source/blender/modifiers/intern/MOD_boolean.c @@ -119,8 +119,7 @@ static DerivedMesh *get_quick_derivedMesh(DerivedMesh *derivedData, DerivedMesh static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *derivedData, - int UNUSED(useRenderParams), - int UNUSED(isFinalCalc)) + ModifierApplyFlag UNUSED(flag)) { BooleanModifierData *bmd = (BooleanModifierData *) md; DerivedMesh *dm; @@ -164,8 +163,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, #else // WITH_MOD_BOOLEAN static DerivedMesh *applyModifier(ModifierData *UNUSED(md), Object *UNUSED(ob), DerivedMesh *derivedData, - int UNUSED(useRenderParams), - int UNUSED(isFinalCalc)) + ModifierApplyFlag UNUSED(flag)) { return derivedData; } diff --git a/source/blender/modifiers/intern/MOD_build.c b/source/blender/modifiers/intern/MOD_build.c index 67a290017f7..9285ec6674c 100644 --- a/source/blender/modifiers/intern/MOD_build.c +++ b/source/blender/modifiers/intern/MOD_build.c @@ -77,8 +77,7 @@ static int dependsOnTime(ModifierData *UNUSED(md)) static DerivedMesh *applyModifier(ModifierData *md, Object *UNUSED(ob), DerivedMesh *derivedData, - int UNUSED(useRenderParams), - int UNUSED(isFinalCalc)) + ModifierApplyFlag UNUSED(flag)) { DerivedMesh *dm = derivedData; DerivedMesh *result; diff --git a/source/blender/modifiers/intern/MOD_cast.c b/source/blender/modifiers/intern/MOD_cast.c index 16ed508d42e..c4772895b03 100644 --- a/source/blender/modifiers/intern/MOD_cast.c +++ b/source/blender/modifiers/intern/MOD_cast.c @@ -581,8 +581,7 @@ static void deformVerts(ModifierData *md, Object *ob, DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts, - int UNUSED(useRenderParams), - int UNUSED(isFinalCalc)) + ModifierApplyFlag UNUSED(flag)) { DerivedMesh *dm = NULL; CastModifierData *cmd = (CastModifierData *)md; diff --git a/source/blender/modifiers/intern/MOD_cloth.c b/source/blender/modifiers/intern/MOD_cloth.c index 33c6117aa05..2c38bc42a8f 100644 --- a/source/blender/modifiers/intern/MOD_cloth.c +++ b/source/blender/modifiers/intern/MOD_cloth.c @@ -68,7 +68,7 @@ static void initData(ModifierData *md) } static void deformVerts(ModifierData *md, Object *ob, DerivedMesh *derivedData, float (*vertexCos)[3], - int UNUSED(numVerts), int UNUSED(useRenderParams), int UNUSED(isFinalCalc)) + int UNUSED(numVerts), ModifierApplyFlag UNUSED(flag)) { DerivedMesh *dm; ClothModifierData *clmd = (ClothModifierData *) md; diff --git a/source/blender/modifiers/intern/MOD_collision.c b/source/blender/modifiers/intern/MOD_collision.c index eb4511ddaec..a3169bdba46 100644 --- a/source/blender/modifiers/intern/MOD_collision.c +++ b/source/blender/modifiers/intern/MOD_collision.c @@ -108,8 +108,7 @@ static void deformVerts(ModifierData *md, Object *ob, DerivedMesh *derivedData, float (*vertexCos)[3], int UNUSED(numVerts), - int UNUSED(useRenderParams), - int UNUSED(isFinalCalc)) + ModifierApplyFlag UNUSED(flag)) { CollisionModifierData *collmd = (CollisionModifierData *) md; DerivedMesh *dm = NULL; diff --git a/source/blender/modifiers/intern/MOD_curve.c b/source/blender/modifiers/intern/MOD_curve.c index 3b46ecc5744..0ce4d74aebb 100644 --- a/source/blender/modifiers/intern/MOD_curve.c +++ b/source/blender/modifiers/intern/MOD_curve.c @@ -114,8 +114,7 @@ static void deformVerts(ModifierData *md, Object *ob, DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts, - int UNUSED(useRenderParams), - int UNUSED(isFinalCalc)) + ModifierApplyFlag UNUSED(flag)) { CurveModifierData *cmd = (CurveModifierData *) md; @@ -133,7 +132,7 @@ static void deformVertsEM( if (!derivedData) dm = CDDM_from_BMEditMesh(editData, ob->data, FALSE, FALSE); - deformVerts(md, ob, dm, vertexCos, numVerts, 0, 0); + deformVerts(md, ob, dm, vertexCos, numVerts, 0); if (!derivedData) dm->release(dm); } diff --git a/source/blender/modifiers/intern/MOD_decimate.c b/source/blender/modifiers/intern/MOD_decimate.c index b28a4a942ac..cb6681bfa68 100644 --- a/source/blender/modifiers/intern/MOD_decimate.c +++ b/source/blender/modifiers/intern/MOD_decimate.c @@ -72,8 +72,7 @@ static void copyData(ModifierData *md, ModifierData *target) #ifdef WITH_MOD_DECIMATE static DerivedMesh *applyModifier(ModifierData *md, Object *UNUSED(ob), DerivedMesh *derivedData, - int UNUSED(useRenderParams), - int UNUSED(isFinalCalc)) + ModifierApplyFlag UNUSED(flag)) { DecimateModifierData *dmd = (DecimateModifierData *) md; DerivedMesh *dm = derivedData, *result = NULL; @@ -196,8 +195,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *UNUSED(ob), #else // WITH_MOD_DECIMATE static DerivedMesh *applyModifier(ModifierData *UNUSED(md), Object *UNUSED(ob), DerivedMesh *derivedData, - int UNUSED(useRenderParams), - int UNUSED(isFinalCalc)) + ModifierApplyFlag UNUSED(flag)) { return derivedData; } diff --git a/source/blender/modifiers/intern/MOD_displace.c b/source/blender/modifiers/intern/MOD_displace.c index fd3ebada170..01592d63bb2 100644 --- a/source/blender/modifiers/intern/MOD_displace.c +++ b/source/blender/modifiers/intern/MOD_displace.c @@ -238,8 +238,7 @@ static void deformVerts(ModifierData *md, Object *ob, DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts, - int UNUSED(useRenderParams), - int UNUSED(isFinalCalc)) + ModifierApplyFlag UNUSED(flag)) { DerivedMesh *dm = get_cddm(ob, NULL, derivedData, vertexCos); diff --git a/source/blender/modifiers/intern/MOD_dynamicpaint.c b/source/blender/modifiers/intern/MOD_dynamicpaint.c index 7f8e476790f..159da9adfcf 100644 --- a/source/blender/modifiers/intern/MOD_dynamicpaint.c +++ b/source/blender/modifiers/intern/MOD_dynamicpaint.c @@ -103,8 +103,7 @@ static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md) static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *dm, - int UNUSED(useRenderParams), - int UNUSED(isFinalCalc)) + ModifierApplyFlag UNUSED(flag)) { DynamicPaintModifierData *pmd = (DynamicPaintModifierData *) md; diff --git a/source/blender/modifiers/intern/MOD_edgesplit.c b/source/blender/modifiers/intern/MOD_edgesplit.c index 794ee6204ed..eb3334d31ce 100644 --- a/source/blender/modifiers/intern/MOD_edgesplit.c +++ b/source/blender/modifiers/intern/MOD_edgesplit.c @@ -140,9 +140,8 @@ static DerivedMesh *edgesplitModifier_do(EdgeSplitModifierData *emd, return doEdgeSplit(dm, emd, ob); } -static DerivedMesh *applyModifier( - ModifierData *md, Object *ob, DerivedMesh *derivedData, - int UNUSED(useRenderParams), int UNUSED(isFinalCalc)) +static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *derivedData, + ModifierApplyFlag UNUSED(flag)) { DerivedMesh *result; EdgeSplitModifierData *emd = (EdgeSplitModifierData *) md; @@ -159,7 +158,7 @@ static DerivedMesh *applyModifierEM(ModifierData *md, Object *ob, struct BMEditMesh *UNUSED(editData), DerivedMesh *derivedData) { - return applyModifier(md, ob, derivedData, 0, 1); + return applyModifier(md, ob, derivedData, MOD_APPLY_USECACHE); } diff --git a/source/blender/modifiers/intern/MOD_explode.c b/source/blender/modifiers/intern/MOD_explode.c index 39932b5673c..b69f167f876 100644 --- a/source/blender/modifiers/intern/MOD_explode.c +++ b/source/blender/modifiers/intern/MOD_explode.c @@ -991,8 +991,7 @@ static ParticleSystemModifierData *findPrecedingParticlesystem(Object *ob, Modif } static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *derivedData, - int UNUSED(useRenderParams), - int UNUSED(isFinalCalc)) + ModifierApplyFlag UNUSED(flag)) { DerivedMesh *dm = derivedData; ExplodeModifierData *emd = (ExplodeModifierData *) md; diff --git a/source/blender/modifiers/intern/MOD_fluidsim.c b/source/blender/modifiers/intern/MOD_fluidsim.c index 4cd88370f4a..694f4f174e8 100644 --- a/source/blender/modifiers/intern/MOD_fluidsim.c +++ b/source/blender/modifiers/intern/MOD_fluidsim.c @@ -78,8 +78,7 @@ static void copyData(ModifierData *md, ModifierData *target) static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *dm, - int useRenderParams, - int isFinalCalc) + ModifierApplyFlag flag) { FluidsimModifierData *fluidmd = (FluidsimModifierData *) md; DerivedMesh *result = NULL; @@ -93,7 +92,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, } } - result = fluidsimModifier_do(fluidmd, md->scene, ob, dm, useRenderParams, isFinalCalc); + result = fluidsimModifier_do(fluidmd, md->scene, ob, dm, flag & MOD_APPLY_RENDER, flag & MOD_APPLY_USECACHE); return result ? result : dm; } diff --git a/source/blender/modifiers/intern/MOD_hook.c b/source/blender/modifiers/intern/MOD_hook.c index 9acf556fc37..19b6bc4a520 100644 --- a/source/blender/modifiers/intern/MOD_hook.c +++ b/source/blender/modifiers/intern/MOD_hook.c @@ -246,7 +246,7 @@ static void deformVerts_do(HookModifierData *hmd, Object *ob, DerivedMesh *dm, static void deformVerts(ModifierData *md, Object *ob, DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts, - int UNUSED(useRenderParams), int UNUSED(isFinalCalc)) + ModifierApplyFlag UNUSED(flag)) { HookModifierData *hmd = (HookModifierData *) md; DerivedMesh *dm = derivedData; diff --git a/source/blender/modifiers/intern/MOD_lattice.c b/source/blender/modifiers/intern/MOD_lattice.c index f815d9629c2..2c05b164d86 100644 --- a/source/blender/modifiers/intern/MOD_lattice.c +++ b/source/blender/modifiers/intern/MOD_lattice.c @@ -110,8 +110,7 @@ static void deformVerts(ModifierData *md, Object *ob, DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts, - int UNUSED(useRenderParams), - int UNUSED(isFinalCalc)) + ModifierApplyFlag UNUSED(flag)) { LatticeModifierData *lmd = (LatticeModifierData *) md; @@ -130,7 +129,7 @@ static void deformVertsEM( if (!derivedData) dm = CDDM_from_BMEditMesh(editData, ob->data, FALSE, FALSE); - deformVerts(md, ob, dm, vertexCos, numVerts, 0, 0); + deformVerts(md, ob, dm, vertexCos, numVerts, 0); if (!derivedData) dm->release(dm); } diff --git a/source/blender/modifiers/intern/MOD_mask.c b/source/blender/modifiers/intern/MOD_mask.c index 8940c4fd079..396e48df50c 100644 --- a/source/blender/modifiers/intern/MOD_mask.c +++ b/source/blender/modifiers/intern/MOD_mask.c @@ -94,8 +94,7 @@ static void updateDepgraph(ModifierData *md, DagForest *forest, static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *derivedData, - int UNUSED(useRenderParams), - int UNUSED(isFinalCalc)) + ModifierApplyFlag UNUSED(flag)) { MaskModifierData *mmd = (MaskModifierData *)md; DerivedMesh *dm = derivedData, *result = NULL; diff --git a/source/blender/modifiers/intern/MOD_meshdeform.c b/source/blender/modifiers/intern/MOD_meshdeform.c index c6f53b49175..12209fd69fb 100644 --- a/source/blender/modifiers/intern/MOD_meshdeform.c +++ b/source/blender/modifiers/intern/MOD_meshdeform.c @@ -341,8 +341,7 @@ static void deformVerts(ModifierData *md, Object *ob, DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts, - int UNUSED(useRenderParams), - int UNUSED(isFinalCalc)) + ModifierApplyFlag UNUSED(flag)) { DerivedMesh *dm = get_dm(ob, NULL, derivedData, NULL, 0); diff --git a/source/blender/modifiers/intern/MOD_mirror.c b/source/blender/modifiers/intern/MOD_mirror.c index 7cbf2718d86..5c9c4e76076 100644 --- a/source/blender/modifiers/intern/MOD_mirror.c +++ b/source/blender/modifiers/intern/MOD_mirror.c @@ -322,8 +322,7 @@ static DerivedMesh *mirrorModifier__doMirror(MirrorModifierData *mmd, static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *derivedData, - int UNUSED(useRenderParams), - int UNUSED(isFinalCalc)) + ModifierApplyFlag UNUSED(flag)) { DerivedMesh *result; MirrorModifierData *mmd = (MirrorModifierData *) md; @@ -340,7 +339,7 @@ static DerivedMesh *applyModifierEM(ModifierData *md, Object *ob, struct BMEditMesh *UNUSED(editData), DerivedMesh *derivedData) { - return applyModifier(md, ob, derivedData, 0, 1); + return applyModifier(md, ob, derivedData, MOD_APPLY_USECACHE); } diff --git a/source/blender/modifiers/intern/MOD_multires.c b/source/blender/modifiers/intern/MOD_multires.c index 42ba66719da..6b181bd2c6d 100644 --- a/source/blender/modifiers/intern/MOD_multires.c +++ b/source/blender/modifiers/intern/MOD_multires.c @@ -71,11 +71,12 @@ static void copyData(ModifierData *md, ModifierData *target) } static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *dm, - int useRenderParams, int isFinalCalc) + ModifierApplyFlag flag) { MultiresModifierData *mmd = (MultiresModifierData *)md; DerivedMesh *result; Mesh *me = (Mesh *)ob->data; + const int useRenderParams = flag & MOD_APPLY_RENDER; if (mmd->totlvl) { if (!CustomData_get_layer(&me->ldata, CD_MDISPS)) { @@ -89,7 +90,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *dm, if (result == dm) return dm; - if (useRenderParams || !isFinalCalc) { + if(useRenderParams || !(flag & MOD_APPLY_USECACHE)) { DerivedMesh *cddm; cddm = CDDM_copy(result); diff --git a/source/blender/modifiers/intern/MOD_ocean.c b/source/blender/modifiers/intern/MOD_ocean.c index 0bf4d46f975..dfbfbd22475 100644 --- a/source/blender/modifiers/intern/MOD_ocean.c +++ b/source/blender/modifiers/intern/MOD_ocean.c @@ -536,8 +536,7 @@ static DerivedMesh *doOcean(ModifierData *md, Object *UNUSED(ob), static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *derivedData, - int UNUSED(useRenderParams), - int UNUSED(isFinalCalc)) + ModifierApplyFlag UNUSED(flag)) { DerivedMesh *result; @@ -553,7 +552,7 @@ static DerivedMesh *applyModifierEM(ModifierData *md, Object *ob, struct BMEditMesh *UNUSED(editData), DerivedMesh *derivedData) { - return applyModifier(md, ob, derivedData, 0, 1); + return applyModifier(md, ob, derivedData, MOD_APPLY_USECACHE); } diff --git a/source/blender/modifiers/intern/MOD_particleinstance.c b/source/blender/modifiers/intern/MOD_particleinstance.c index fd48afec5cd..82ab8db9c36 100644 --- a/source/blender/modifiers/intern/MOD_particleinstance.c +++ b/source/blender/modifiers/intern/MOD_particleinstance.c @@ -107,8 +107,7 @@ static void foreachObjectLink(ModifierData *md, Object *ob, static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *derivedData, - int UNUSED(useRenderParams), - int UNUSED(isFinalCalc)) + ModifierApplyFlag UNUSED(flag)) { DerivedMesh *dm = derivedData, *result; ParticleInstanceModifierData *pimd = (ParticleInstanceModifierData *) md; @@ -330,7 +329,7 @@ static DerivedMesh *applyModifierEM(ModifierData *md, Object *ob, struct BMEditMesh *UNUSED(editData), DerivedMesh *derivedData) { - return applyModifier(md, ob, derivedData, 0, 1); + return applyModifier(md, ob, derivedData, MOD_APPLY_USECACHE); } diff --git a/source/blender/modifiers/intern/MOD_particlesystem.c b/source/blender/modifiers/intern/MOD_particlesystem.c index 71c77621dfa..0cf36677807 100644 --- a/source/blender/modifiers/intern/MOD_particlesystem.c +++ b/source/blender/modifiers/intern/MOD_particlesystem.c @@ -124,8 +124,7 @@ static void deformVerts(ModifierData *md, Object *ob, DerivedMesh *derivedData, float (*vertexCos)[3], int UNUSED(numVerts), - int UNUSED(useRenderParams), - int UNUSED(isFinalCalc)) + ModifierApplyFlag UNUSED(flag)) { DerivedMesh *dm = derivedData; ParticleSystemModifierData *psmd = (ParticleSystemModifierData *) md; diff --git a/source/blender/modifiers/intern/MOD_remesh.c b/source/blender/modifiers/intern/MOD_remesh.c index 741014ebc7f..37bfd0e6f45 100644 --- a/source/blender/modifiers/intern/MOD_remesh.c +++ b/source/blender/modifiers/intern/MOD_remesh.c @@ -147,8 +147,7 @@ static void dualcon_add_quad(void *output_v, const int vert_indices[4]) static DerivedMesh *applyModifier(ModifierData *md, Object *UNUSED(ob), DerivedMesh *dm, - int UNUSED(useRenderParams), - int UNUSED(isFinalCalc)) + ModifierApplyFlag UNUSED(flag)) { RemeshModifierData *rmd; DualConOutput *output; @@ -200,8 +199,7 @@ static DerivedMesh *applyModifier(ModifierData *md, static DerivedMesh *applyModifier(ModifierData *UNUSED(md), Object *UNUSED(ob), DerivedMesh *derivedData, - int UNUSED(useRenderParams), - int UNUSED(isFinalCalc)) + ModifierApplyFlag UNUSED(flag)) { return derivedData; } diff --git a/source/blender/modifiers/intern/MOD_screw.c b/source/blender/modifiers/intern/MOD_screw.c index e6cff1c042f..6a57cd82b50 100644 --- a/source/blender/modifiers/intern/MOD_screw.c +++ b/source/blender/modifiers/intern/MOD_screw.c @@ -134,12 +134,12 @@ static void copyData(ModifierData *md, ModifierData *target) static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *derivedData, - int useRenderParams, - int UNUSED(isFinalCalc)) + ModifierApplyFlag flag) { DerivedMesh *dm = derivedData; DerivedMesh *result; ScrewModifierData *ltmd = (ScrewModifierData *) md; + const int useRenderParams = flag & MOD_APPLY_RENDER; int *origindex; int mpoly_index = 0; @@ -940,7 +940,7 @@ static DerivedMesh *applyModifierEM( struct BMEditMesh *UNUSED(editData), DerivedMesh *derivedData) { - return applyModifier(md, ob, derivedData, 0, 1); + return applyModifier(md, ob, derivedData, MOD_APPLY_USECACHE); } static int dependsOnTime(ModifierData *UNUSED(md)) diff --git a/source/blender/modifiers/intern/MOD_shapekey.c b/source/blender/modifiers/intern/MOD_shapekey.c index 0f67eb4dd1a..3353382fa3d 100644 --- a/source/blender/modifiers/intern/MOD_shapekey.c +++ b/source/blender/modifiers/intern/MOD_shapekey.c @@ -52,8 +52,7 @@ static void deformVerts(ModifierData *md, Object *ob, DerivedMesh *UNUSED(derivedData), float (*vertexCos)[3], int numVerts, - int UNUSED(useRenderParams), - int UNUSED(isFinalCalc)) + ModifierApplyFlag UNUSED(flag)) { KeyBlock *kb = ob_get_keyblock(ob); float (*deformedVerts)[3]; @@ -86,7 +85,7 @@ static void deformMatrices(ModifierData *md, Object *ob, DerivedMesh *derivedDat copy_m3_m3(defMats[a], scale); } - deformVerts(md, ob, derivedData, vertexCos, numVerts, 0, 0); + deformVerts(md, ob, derivedData, vertexCos, numVerts, 0); } static void deformVertsEM(ModifierData *md, Object *ob, @@ -98,7 +97,7 @@ static void deformVertsEM(ModifierData *md, Object *ob, Key *key = ob_get_key(ob); if (key && key->type == KEY_RELATIVE) - deformVerts(md, ob, derivedData, vertexCos, numVerts, 0, 0); + deformVerts(md, ob, derivedData, vertexCos, numVerts, 0); } static void deformMatricesEM(ModifierData *UNUSED(md), Object *ob, diff --git a/source/blender/modifiers/intern/MOD_shrinkwrap.c b/source/blender/modifiers/intern/MOD_shrinkwrap.c index bcbd8918609..45cd33efea8 100644 --- a/source/blender/modifiers/intern/MOD_shrinkwrap.c +++ b/source/blender/modifiers/intern/MOD_shrinkwrap.c @@ -114,8 +114,7 @@ static void deformVerts(ModifierData *md, Object *ob, DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts, - int UNUSED(useRenderParams), - int UNUSED(isFinalCalc)) + ModifierApplyFlag UNUSED(flag)) { DerivedMesh *dm = derivedData; CustomDataMask dataMask = requiredDataMask(ob, md); diff --git a/source/blender/modifiers/intern/MOD_simpledeform.c b/source/blender/modifiers/intern/MOD_simpledeform.c index d2ef75bfa42..36c052440b6 100644 --- a/source/blender/modifiers/intern/MOD_simpledeform.c +++ b/source/blender/modifiers/intern/MOD_simpledeform.c @@ -307,8 +307,7 @@ static void deformVerts(ModifierData *md, Object *ob, DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts, - int UNUSED(useRenderParams), - int UNUSED(isFinalCalc)) + ModifierApplyFlag UNUSED(flag)) { DerivedMesh *dm = derivedData; CustomDataMask dataMask = requiredDataMask(ob, md); diff --git a/source/blender/modifiers/intern/MOD_smoke.c b/source/blender/modifiers/intern/MOD_smoke.c index 843f92bbbe8..7092ef04d0f 100644 --- a/source/blender/modifiers/intern/MOD_smoke.c +++ b/source/blender/modifiers/intern/MOD_smoke.c @@ -85,8 +85,7 @@ static void deformVerts(ModifierData *md, Object *ob, DerivedMesh *derivedData, float (*vertexCos)[3], int UNUSED(numVerts), - int UNUSED(useRenderParams), - int UNUSED(isFinalCalc)) + ModifierApplyFlag UNUSED(flag)) { SmokeModifierData *smd = (SmokeModifierData *) md; DerivedMesh *dm = get_cddm(ob, NULL, derivedData, vertexCos); diff --git a/source/blender/modifiers/intern/MOD_smooth.c b/source/blender/modifiers/intern/MOD_smooth.c index ac0eb2a369b..99a5dcb5ef5 100644 --- a/source/blender/modifiers/intern/MOD_smooth.c +++ b/source/blender/modifiers/intern/MOD_smooth.c @@ -212,9 +212,8 @@ static void smoothModifier_do( MEM_freeN(uctmp); } -static void deformVerts( - ModifierData *md, Object *ob, DerivedMesh *derivedData, - float (*vertexCos)[3], int numVerts, int UNUSED(useRenderParams), int UNUSED(isFinalCalc)) +static void deformVerts(ModifierData *md, Object *ob, DerivedMesh *derivedData, + float (*vertexCos)[3], int numVerts, ModifierApplyFlag UNUSED(flag)) { DerivedMesh *dm = get_dm(ob, NULL, derivedData, NULL, 0); diff --git a/source/blender/modifiers/intern/MOD_softbody.c b/source/blender/modifiers/intern/MOD_softbody.c index 5d428aedf8c..75a98bc0746 100644 --- a/source/blender/modifiers/intern/MOD_softbody.c +++ b/source/blender/modifiers/intern/MOD_softbody.c @@ -48,8 +48,7 @@ static void deformVerts(ModifierData *md, Object *ob, DerivedMesh *UNUSED(derivedData), float (*vertexCos)[3], int numVerts, - int UNUSED(useRenderParams), - int UNUSED(isFinalCalc)) + ModifierApplyFlag UNUSED(flag)) { sbObjectStep(md->scene, ob, (float)md->scene->r.cfra, vertexCos, numVerts); } diff --git a/source/blender/modifiers/intern/MOD_solidify.c b/source/blender/modifiers/intern/MOD_solidify.c index 4ce1a283acf..264d84af81e 100644 --- a/source/blender/modifiers/intern/MOD_solidify.c +++ b/source/blender/modifiers/intern/MOD_solidify.c @@ -204,8 +204,7 @@ static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md) static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *dm, - int UNUSED(useRenderParams), - int UNUSED(isFinalCalc)) + ModifierApplyFlag UNUSED(flag)) { int i; DerivedMesh *result; @@ -753,7 +752,7 @@ static DerivedMesh *applyModifierEM(ModifierData *md, struct BMEditMesh *UNUSED(editData), DerivedMesh *derivedData) { - return applyModifier(md, ob, derivedData, 0, 1); + return applyModifier(md, ob, derivedData, MOD_APPLY_USECACHE); } diff --git a/source/blender/modifiers/intern/MOD_subsurf.c b/source/blender/modifiers/intern/MOD_subsurf.c index ebd95992090..16824139d60 100644 --- a/source/blender/modifiers/intern/MOD_subsurf.c +++ b/source/blender/modifiers/intern/MOD_subsurf.c @@ -91,14 +91,15 @@ static int isDisabled(ModifierData *md, int useRenderParams) static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *derivedData, - int useRenderParams, - int isFinalCalc) + ModifierApplyFlag flag) { SubsurfModifierData *smd = (SubsurfModifierData *) md; DerivedMesh *result; + const int useRenderParams = flag & MOD_APPLY_RENDER; + const int isFinalCalc = flag & MOD_APPLY_USECACHE; - result = subsurf_make_derived_from_derived(derivedData, smd, - useRenderParams, NULL, isFinalCalc, 0, (ob->flag & OB_MODE_EDIT)); + result = subsurf_make_derived_from_derived(derivedData, smd, useRenderParams, NULL, + isFinalCalc, 0, (ob->flag & OB_MODE_EDIT)); if (useRenderParams || !isFinalCalc) { DerivedMesh *cddm = CDDM_copy(result); diff --git a/source/blender/modifiers/intern/MOD_surface.c b/source/blender/modifiers/intern/MOD_surface.c index 9483dede73d..4e7aaf9d0ba 100644 --- a/source/blender/modifiers/intern/MOD_surface.c +++ b/source/blender/modifiers/intern/MOD_surface.c @@ -89,8 +89,7 @@ static void deformVerts(ModifierData *md, Object *ob, DerivedMesh *derivedData, float (*vertexCos)[3], int UNUSED(numVerts), - int UNUSED(useRenderParams), - int UNUSED(isFinalCalc)) + ModifierApplyFlag UNUSED(flag)) { SurfaceModifierData *surmd = (SurfaceModifierData *) md; diff --git a/source/blender/modifiers/intern/MOD_uvproject.c b/source/blender/modifiers/intern/MOD_uvproject.c index ccfda6af59f..eb5a74f0dcc 100644 --- a/source/blender/modifiers/intern/MOD_uvproject.c +++ b/source/blender/modifiers/intern/MOD_uvproject.c @@ -390,8 +390,7 @@ static DerivedMesh *uvprojectModifier_do(UVProjectModifierData *umd, static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *derivedData, - int UNUSED(useRenderParams), - int UNUSED(isFinalCalc)) + ModifierApplyFlag UNUSED(flag)) { DerivedMesh *result; UVProjectModifierData *umd = (UVProjectModifierData *) md; @@ -405,7 +404,7 @@ static DerivedMesh *applyModifierEM(ModifierData *md, Object *ob, struct BMEditMesh *UNUSED(editData), DerivedMesh *derivedData) { - return applyModifier(md, ob, derivedData, 0, 1); + return applyModifier(md, ob, derivedData, MOD_APPLY_USECACHE); } diff --git a/source/blender/modifiers/intern/MOD_warp.c b/source/blender/modifiers/intern/MOD_warp.c index 1a654351ea8..9eb360f6819 100644 --- a/source/blender/modifiers/intern/MOD_warp.c +++ b/source/blender/modifiers/intern/MOD_warp.c @@ -317,7 +317,7 @@ static int warp_needs_dm(WarpModifierData *wmd) } static void deformVerts(ModifierData *md, Object *ob, DerivedMesh *derivedData, - float (*vertexCos)[3], int numVerts, int UNUSED(useRenderParams), int UNUSED(isFinalCalc)) + float (*vertexCos)[3], int numVerts, ModifierApplyFlag UNUSED(flag)) { DerivedMesh *dm = NULL; int use_dm = warp_needs_dm((WarpModifierData *)md); @@ -344,7 +344,7 @@ static void deformVertsEM(ModifierData *md, Object *ob, struct BMEditMesh *editD dm = CDDM_from_BMEditMesh(editData, ob->data, FALSE, FALSE); } - deformVerts(md, ob, dm, vertexCos, numVerts, 0, 0); + deformVerts(md, ob, dm, vertexCos, numVerts, 0); if (use_dm) { if (!derivedData) dm->release(dm); diff --git a/source/blender/modifiers/intern/MOD_wave.c b/source/blender/modifiers/intern/MOD_wave.c index 042401ee26f..440d2c157fe 100644 --- a/source/blender/modifiers/intern/MOD_wave.c +++ b/source/blender/modifiers/intern/MOD_wave.c @@ -327,8 +327,7 @@ static void deformVerts(ModifierData *md, Object *ob, DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts, - int UNUSED(useRenderParams), - int UNUSED(isFinalCalc)) + ModifierApplyFlag UNUSED(flag)) { DerivedMesh *dm = derivedData; WaveModifierData *wmd = (WaveModifierData *)md; diff --git a/source/blender/modifiers/intern/MOD_weightvgedit.c b/source/blender/modifiers/intern/MOD_weightvgedit.c index 639b8bb2593..ce6295e30cf 100644 --- a/source/blender/modifiers/intern/MOD_weightvgedit.c +++ b/source/blender/modifiers/intern/MOD_weightvgedit.c @@ -176,7 +176,7 @@ static int isDisabled(ModifierData *md, int UNUSED(useRenderParams)) } static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *derivedData, - int UNUSED(useRenderParams), int UNUSED(isFinalCalc)) + ModifierApplyFlag UNUSED(flag)) { WeightVGEditModifierData *wmd = (WeightVGEditModifierData *) md; DerivedMesh *dm = derivedData; @@ -271,7 +271,7 @@ static DerivedMesh *applyModifierEM(ModifierData *md, Object *ob, struct BMEditMesh *UNUSED(editData), DerivedMesh *derivedData) { - return applyModifier(md, ob, derivedData, 0, 1); + return applyModifier(md, ob, derivedData, MOD_APPLY_USECACHE); } diff --git a/source/blender/modifiers/intern/MOD_weightvgmix.c b/source/blender/modifiers/intern/MOD_weightvgmix.c index cf11e9d98b0..2961082b448 100644 --- a/source/blender/modifiers/intern/MOD_weightvgmix.c +++ b/source/blender/modifiers/intern/MOD_weightvgmix.c @@ -218,7 +218,7 @@ static int isDisabled(ModifierData *md, int UNUSED(useRenderParams)) } static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *derivedData, - int UNUSED(useRenderParams), int UNUSED(isFinalCalc)) + ModifierApplyFlag UNUSED(flag)) { WeightVGMixModifierData *wmd = (WeightVGMixModifierData *) md; DerivedMesh *dm = derivedData; @@ -402,7 +402,7 @@ static DerivedMesh *applyModifierEM(ModifierData *md, Object *ob, struct BMEditMesh *UNUSED(editData), DerivedMesh *derivedData) { - return applyModifier(md, ob, derivedData, 0, 1); + return applyModifier(md, ob, derivedData, MOD_APPLY_USECACHE); } diff --git a/source/blender/modifiers/intern/MOD_weightvgproximity.c b/source/blender/modifiers/intern/MOD_weightvgproximity.c index 0c130731c05..70b9eafdac5 100644 --- a/source/blender/modifiers/intern/MOD_weightvgproximity.c +++ b/source/blender/modifiers/intern/MOD_weightvgproximity.c @@ -338,7 +338,7 @@ static int isDisabled(ModifierData *md, int UNUSED(useRenderParams)) } static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *derivedData, - int UNUSED(useRenderParams), int UNUSED(isFinalCalc)) + ModifierApplyFlag UNUSED(flag)) { WeightVGProximityModifierData *wmd = (WeightVGProximityModifierData *) md; DerivedMesh *dm = derivedData; @@ -537,7 +537,7 @@ static DerivedMesh *applyModifierEM(ModifierData *md, Object *ob, struct BMEditMesh *UNUSED(editData), DerivedMesh *derivedData) { - return applyModifier(md, ob, derivedData, 0, 1); + return applyModifier(md, ob, derivedData, MOD_APPLY_USECACHE); }