Refactor of modifiers' apply function: now use a single bit-flag parameter to pass options, instead of having one parameter per boolean flag (i.e. replaces current useRenderParams and isFinalCalc by a single ModifierApplyFlag flag. ModifierApplyFlag is an enum defined in BKE_modifier.h). This way we won't anymore have to edit all modifier files when e.g. adding a new control flag!

Should have no effect over modifier behavior.
This commit is contained in:
Bastien Montagne 2012-05-09 15:00:26 +00:00
parent 895e426e26
commit 318b44fe5d
48 changed files with 125 additions and 131 deletions

@ -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 (*IDWalkFunc)(void *userData, struct Object *ob, struct ID **idpoin);
typedef void (*TexWalkFunc)(void *userData, struct Object *ob, struct ModifierData *md, const char *propname); 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 { typedef struct ModifierTypeInfo {
/* The user visible name for this modifier */ /* The user visible name for this modifier */
char name[32]; char name[32];
@ -142,7 +148,7 @@ typedef struct ModifierTypeInfo {
void (*deformVerts)(struct ModifierData *md, struct Object *ob, void (*deformVerts)(struct ModifierData *md, struct Object *ob,
struct DerivedMesh *derivedData, struct DerivedMesh *derivedData,
float (*vertexCos)[3], int numVerts, float (*vertexCos)[3], int numVerts,
int useRenderParams, int isFinalCalc); ModifierApplyFlag flag);
/* Like deformMatricesEM but called from object mode (for supporting modifiers in sculpt mode) */ /* Like deformMatricesEM but called from object mode (for supporting modifiers in sculpt mode) */
void (*deformMatrices)( void (*deformMatrices)(
@ -187,7 +193,7 @@ typedef struct ModifierTypeInfo {
struct DerivedMesh *(*applyModifier)( struct DerivedMesh *(*applyModifier)(
struct ModifierData *md, struct Object *ob, struct ModifierData *md, struct Object *ob,
struct DerivedMesh *derivedData, struct DerivedMesh *derivedData,
int useRenderParams, int isFinalCalc); ModifierApplyFlag flag);
/* Like applyModifier but called during editmode (for supporting /* Like applyModifier but called during editmode (for supporting
* modifiers). * modifiers).

@ -814,7 +814,7 @@ DerivedMesh *mesh_create_derived_for_modifier(Scene *scene, Object *ob,
int numVerts; int numVerts;
float (*deformedVerts)[3] = mesh_getVertexCos(me, &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); dm = mesh_create_derived(me, ob, deformedVerts);
if (build_shapekey_layers) if (build_shapekey_layers)
@ -828,7 +828,7 @@ DerivedMesh *mesh_create_derived_for_modifier(Scene *scene, Object *ob,
if (build_shapekey_layers) if (build_shapekey_layers)
add_shapekey_layers(tdm, me, ob); 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); 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. */ /* XXX Same as above... For now, only weights preview in WPaint mode. */
const int do_mod_wmcol = do_init_wmcol; 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) if (mmd && !mmd->sculptlvl)
has_multires = 0; has_multires = 0;
@ -1434,7 +1441,7 @@ static void mesh_calc_modifiers(Scene *scene, Object *ob, float (*inputVertexCos
if (!deformedVerts) if (!deformedVerts)
deformedVerts = mesh_getVertexCos(me, &numVerts); 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 { else {
break; 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 { else {
DerivedMesh *ndm; 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 (ndm) {
/* if the modifier returned a new dm, release the old one */ /* 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; nextmask &= ~CD_MASK_ORCO;
DM_set_only_copy(orcodm, nextmask | CD_MASK_ORIGINDEX); 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 (ndm) {
/* if the modifier returned a new dm, release the old one */ /* 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; nextmask &= ~CD_MASK_CLOTH_ORCO;
DM_set_only_copy(clothorcodm, nextmask | CD_MASK_ORIGINDEX); 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 (ndm) {
/* if the modifier returned a new dm, release the old one */ /* 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) if (mti->deformVertsEM)
mti->deformVertsEM(md, ob, em, dm, deformedVerts, numVerts); 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 { else {
DerivedMesh *ndm; DerivedMesh *ndm;
@ -1971,7 +1979,7 @@ static void editbmesh_calc_modifiers(Scene *scene, Object *ob, BMEditMesh *em, D
if (mti->applyModifierEM) if (mti->applyModifierEM)
ndm = mti->applyModifierEM(md, ob, em, orcodm); ndm = mti->applyModifierEM(md, ob, em, orcodm);
else else
ndm = mti->applyModifier(md, ob, orcodm, 0, 0); ndm = mti->applyModifier(md, ob, orcodm, 0);
if (ndm) { if (ndm) {
/* if the modifier returned a new dm, release the old one */ /* 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) if (mti->applyModifierEM)
ndm = mti->applyModifierEM(md, ob, em, dm); ndm = mti->applyModifierEM(md, ob, em, dm);
else else
ndm = mti->applyModifier(md, ob, dm, 0, 0); ndm = mti->applyModifier(md, ob, dm, 0);
if (ndm) { if (ndm) {
if (dm && dm != ndm) if (dm && dm != ndm)

@ -752,14 +752,19 @@ static void curve_calc_modifiers_pre(Scene *scene, Object *ob, int forRender, fl
Curve *cu = ob->data; Curve *cu = ob->data;
ListBase *nurb = BKE_curve_nurbs_get(cu); ListBase *nurb = BKE_curve_nurbs_get(cu);
int numVerts = 0; int numVerts = 0;
int editmode = (!forRender && cu->editnurb); const int editmode = (!forRender && cu->editnurb);
ModifierApplyFlag app_flag = 0;
float (*originalVerts)[3] = NULL; float (*originalVerts)[3] = NULL;
float (*deformedVerts)[3] = NULL; float (*deformedVerts)[3] = NULL;
float *keyVerts = NULL; float *keyVerts = NULL;
int required_mode; int required_mode;
if (forRender) if (editmode)
app_flag |= MOD_APPLY_USECACHE;
if (forRender) {
app_flag |= MOD_APPLY_RENDER;
required_mode = eModifierMode_Render; required_mode = eModifierMode_Render;
}
else else
required_mode = eModifierMode_Realtime; 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); 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) if (md == pretessellatePoint)
break; break;
@ -866,9 +871,12 @@ static void curve_calc_modifiers_post(Scene *scene, Object *ob, ListBase *dispba
DerivedMesh *dm = NULL, *ndm; DerivedMesh *dm = NULL, *ndm;
float (*vertCos)[3] = NULL; float (*vertCos)[3] = NULL;
int useCache = !forRender; int useCache = !forRender;
ModifierApplyFlag app_flag = 0;
if (forRender) if (forRender) {
app_flag |= MOD_APPLY_RENDER;
required_mode = eModifierMode_Render; required_mode = eModifierMode_Render;
}
else else
required_mode = eModifierMode_Realtime; 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) { for (; md; md = md->next) {
ModifierTypeInfo *mti = modifierType_getInfo(md->type); ModifierTypeInfo *mti = modifierType_getInfo(md->type);
ModifierApplyFlag appf = app_flag;
md->scene = scene; md->scene = scene;
@ -897,6 +906,8 @@ static void curve_calc_modifiers_post(Scene *scene, Object *ob, ListBase *dispba
if (mti->type == eModifierTypeType_OnlyDeform || if (mti->type == eModifierTypeType_OnlyDeform ||
(mti->type == eModifierTypeType_DeformOrConstruct && !dm)) { (mti->type == eModifierTypeType_DeformOrConstruct && !dm)) {
if (editmode)
appf |= MOD_APPLY_USECACHE;
if (dm) { if (dm) {
if (!vertCos) { if (!vertCos) {
totvert = dm->getNumVerts(dm); totvert = dm->getNumVerts(dm);
@ -904,14 +915,14 @@ static void curve_calc_modifiers_post(Scene *scene, Object *ob, ListBase *dispba
dm->getVertCos(dm, vertCos); dm->getVertCos(dm, vertCos);
} }
mti->deformVerts(md, ob, dm, vertCos, totvert, forRender, editmode); mti->deformVerts(md, ob, dm, vertCos, totvert, appf);
} }
else { else {
if (!vertCos) { if (!vertCos) {
vertCos = displist_get_allverts(dispbase, &totvert); vertCos = displist_get_allverts(dispbase, &totvert);
} }
mti->deformVerts(md, ob, NULL, vertCos, totvert, forRender, editmode); mti->deformVerts(md, ob, NULL, vertCos, totvert, appf);
} }
} }
else { else {
@ -953,7 +964,9 @@ static void curve_calc_modifiers_post(Scene *scene, Object *ob, ListBase *dispba
vertCos = NULL; 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) { if (ndm) {
/* Modifier returned a new derived mesh */ /* 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 required_mode;
int editmode = (!forRender && cu->editnurb); int editmode = (!forRender && cu->editnurb);
DerivedMesh *ndm, *orcodm = NULL; DerivedMesh *ndm, *orcodm = NULL;
const ModifierApplyFlag app_flag = forRender ? MOD_APPLY_RENDER : 0;
if (forRender) if (forRender)
required_mode = eModifierMode_Render; required_mode = eModifierMode_Render;
@ -1114,7 +1128,7 @@ static void curve_calc_orcodm(Scene *scene, Object *ob, DerivedMesh *derivedFina
if (!orcodm) if (!orcodm)
orcodm = create_orco_dm(scene, ob); 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 (ndm) {
/* if the modifier returned a new dm, release the old one */ /* if the modifier returned a new dm, release the old one */

@ -976,7 +976,7 @@ void BKE_lattice_modifiers_calc(Scene *scene, Object *ob)
if (mti->type != eModifierTypeType_OnlyDeform) continue; if (mti->type != eModifierTypeType_OnlyDeform) continue;
if (!vertexCos) vertexCos = BKE_lattice_vertexcos_get(ob, &numVerts); 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 */ /* always displist to make this work like derivedmesh */

@ -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 *tdm = mesh_get_derived_deform(scene, ob, CD_MASK_BAREMESH);
DerivedMesh *dm; DerivedMesh *dm;
dm = mti->applyModifier(md, ob, tdm, 0, 1); dm = mti->applyModifier(md, ob, tdm, MOD_APPLY_USECACHE);
if (dm == tdm) { if (dm == tdm) {
dm = CDDM_copy(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"); deformedVerts = MEM_callocN(sizeof(float) * numVerts * 3, "multiresReshape_deformVerts");
dm->getVertCos(dm, deformedVerts); 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); ndm = CDDM_copy(dm);
CDDM_apply_vert_coords(ndm, deformedVerts); CDDM_apply_vert_coords(ndm, deformedVerts);

@ -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"); BKE_report(reports, RPT_INFO, "Applied modifier only changed CV points, not tessellated/bevel vertices");
vertexCos = BKE_curve_vertexCos_get(cu, &cu->nurb, &numVerts); 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); BK_curve_vertexCos_apply(cu, &cu->nurb, vertexCos);
MEM_freeN(vertexCos); MEM_freeN(vertexCos);

@ -388,7 +388,7 @@ void crazyspace_build_sculpt(Scene *scene, Object *ob, float (**deformmats)[3][3
if (mti->deformMatrices && !deformed) if (mti->deformMatrices && !deformed)
continue; continue;
mti->deformVerts(md, ob, NULL, deformedVerts, me->totvert, 0, 0); mti->deformVerts(md, ob, NULL, deformedVerts, me->totvert, 0);
deformed = 1; deformed = 1;
} }
} }

@ -118,8 +118,7 @@ static void deformVerts(ModifierData *md, Object *ob,
DerivedMesh *derivedData, DerivedMesh *derivedData,
float (*vertexCos)[3], float (*vertexCos)[3],
int numVerts, int numVerts,
int UNUSED(useRenderParams), ModifierApplyFlag UNUSED(flag))
int UNUSED(isFinalCalc))
{ {
ArmatureModifierData *amd = (ArmatureModifierData *) md; ArmatureModifierData *amd = (ArmatureModifierData *) md;

@ -542,8 +542,7 @@ static DerivedMesh *arrayModifier_doArray(ArrayModifierData *amd,
static DerivedMesh *applyModifier(ModifierData *md, Object *ob, static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
DerivedMesh *dm, DerivedMesh *dm,
int UNUSED(useRenderParams), ModifierApplyFlag UNUSED(flag))
int UNUSED(isFinalCalc))
{ {
DerivedMesh *result; DerivedMesh *result;
ArrayModifierData *amd = (ArrayModifierData *) md; ArrayModifierData *amd = (ArrayModifierData *) md;
@ -560,7 +559,7 @@ static DerivedMesh *applyModifierEM(ModifierData *md, Object *ob,
struct BMEditMesh *UNUSED(editData), struct BMEditMesh *UNUSED(editData),
DerivedMesh *dm) DerivedMesh *dm)
{ {
return applyModifier(md, ob, dm, 0, 1); return applyModifier(md, ob, dm, MOD_APPLY_USECACHE);
} }

@ -107,8 +107,7 @@ static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md)
*/ */
static DerivedMesh *applyModifier(ModifierData *md, struct Object *UNUSED(ob), static DerivedMesh *applyModifier(ModifierData *md, struct Object *UNUSED(ob),
DerivedMesh *dm, DerivedMesh *dm,
int UNUSED(useRenderParams), ModifierApplyFlag UNUSED(flag))
int UNUSED(isFinalCalc))
{ {
DerivedMesh *result; DerivedMesh *result;
BMesh *bm; BMesh *bm;
@ -161,8 +160,7 @@ static DerivedMesh *applyModifier(ModifierData *md, struct Object *UNUSED(ob),
static DerivedMesh *applyModifier(ModifierData *md, Object *UNUSED(ob), static DerivedMesh *applyModifier(ModifierData *md, Object *UNUSED(ob),
DerivedMesh *derivedData, DerivedMesh *derivedData,
int UNUSED(useRenderParams), ModifierApplyFlag UNUSED(flag))
int UNUSED(isFinalCalc))
{ {
DerivedMesh *result; DerivedMesh *result;
BMEditMesh *em; BMEditMesh *em;
@ -202,7 +200,7 @@ static DerivedMesh *applyModifierEM(ModifierData *md, Object *ob,
struct BMEditMesh *UNUSED(editData), struct BMEditMesh *UNUSED(editData),
DerivedMesh *derivedData) DerivedMesh *derivedData)
{ {
return applyModifier(md, ob, derivedData, 0, 1); return applyModifier(md, ob, derivedData, MOD_APPLY_USECACHE);
} }

@ -119,8 +119,7 @@ static DerivedMesh *get_quick_derivedMesh(DerivedMesh *derivedData, DerivedMesh
static DerivedMesh *applyModifier(ModifierData *md, Object *ob, static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
DerivedMesh *derivedData, DerivedMesh *derivedData,
int UNUSED(useRenderParams), ModifierApplyFlag UNUSED(flag))
int UNUSED(isFinalCalc))
{ {
BooleanModifierData *bmd = (BooleanModifierData *) md; BooleanModifierData *bmd = (BooleanModifierData *) md;
DerivedMesh *dm; DerivedMesh *dm;
@ -164,8 +163,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
#else // WITH_MOD_BOOLEAN #else // WITH_MOD_BOOLEAN
static DerivedMesh *applyModifier(ModifierData *UNUSED(md), Object *UNUSED(ob), static DerivedMesh *applyModifier(ModifierData *UNUSED(md), Object *UNUSED(ob),
DerivedMesh *derivedData, DerivedMesh *derivedData,
int UNUSED(useRenderParams), ModifierApplyFlag UNUSED(flag))
int UNUSED(isFinalCalc))
{ {
return derivedData; return derivedData;
} }

@ -77,8 +77,7 @@ static int dependsOnTime(ModifierData *UNUSED(md))
static DerivedMesh *applyModifier(ModifierData *md, Object *UNUSED(ob), static DerivedMesh *applyModifier(ModifierData *md, Object *UNUSED(ob),
DerivedMesh *derivedData, DerivedMesh *derivedData,
int UNUSED(useRenderParams), ModifierApplyFlag UNUSED(flag))
int UNUSED(isFinalCalc))
{ {
DerivedMesh *dm = derivedData; DerivedMesh *dm = derivedData;
DerivedMesh *result; DerivedMesh *result;

@ -581,8 +581,7 @@ static void deformVerts(ModifierData *md, Object *ob,
DerivedMesh *derivedData, DerivedMesh *derivedData,
float (*vertexCos)[3], float (*vertexCos)[3],
int numVerts, int numVerts,
int UNUSED(useRenderParams), ModifierApplyFlag UNUSED(flag))
int UNUSED(isFinalCalc))
{ {
DerivedMesh *dm = NULL; DerivedMesh *dm = NULL;
CastModifierData *cmd = (CastModifierData *)md; CastModifierData *cmd = (CastModifierData *)md;

@ -68,7 +68,7 @@ static void initData(ModifierData *md)
} }
static void deformVerts(ModifierData *md, Object *ob, DerivedMesh *derivedData, float (*vertexCos)[3], 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; DerivedMesh *dm;
ClothModifierData *clmd = (ClothModifierData *) md; ClothModifierData *clmd = (ClothModifierData *) md;

@ -108,8 +108,7 @@ static void deformVerts(ModifierData *md, Object *ob,
DerivedMesh *derivedData, DerivedMesh *derivedData,
float (*vertexCos)[3], float (*vertexCos)[3],
int UNUSED(numVerts), int UNUSED(numVerts),
int UNUSED(useRenderParams), ModifierApplyFlag UNUSED(flag))
int UNUSED(isFinalCalc))
{ {
CollisionModifierData *collmd = (CollisionModifierData *) md; CollisionModifierData *collmd = (CollisionModifierData *) md;
DerivedMesh *dm = NULL; DerivedMesh *dm = NULL;

@ -114,8 +114,7 @@ static void deformVerts(ModifierData *md, Object *ob,
DerivedMesh *derivedData, DerivedMesh *derivedData,
float (*vertexCos)[3], float (*vertexCos)[3],
int numVerts, int numVerts,
int UNUSED(useRenderParams), ModifierApplyFlag UNUSED(flag))
int UNUSED(isFinalCalc))
{ {
CurveModifierData *cmd = (CurveModifierData *) md; CurveModifierData *cmd = (CurveModifierData *) md;
@ -133,7 +132,7 @@ static void deformVertsEM(
if (!derivedData) dm = CDDM_from_BMEditMesh(editData, ob->data, FALSE, FALSE); 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); if (!derivedData) dm->release(dm);
} }

@ -72,8 +72,7 @@ static void copyData(ModifierData *md, ModifierData *target)
#ifdef WITH_MOD_DECIMATE #ifdef WITH_MOD_DECIMATE
static DerivedMesh *applyModifier(ModifierData *md, Object *UNUSED(ob), static DerivedMesh *applyModifier(ModifierData *md, Object *UNUSED(ob),
DerivedMesh *derivedData, DerivedMesh *derivedData,
int UNUSED(useRenderParams), ModifierApplyFlag UNUSED(flag))
int UNUSED(isFinalCalc))
{ {
DecimateModifierData *dmd = (DecimateModifierData *) md; DecimateModifierData *dmd = (DecimateModifierData *) md;
DerivedMesh *dm = derivedData, *result = NULL; DerivedMesh *dm = derivedData, *result = NULL;
@ -196,8 +195,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *UNUSED(ob),
#else // WITH_MOD_DECIMATE #else // WITH_MOD_DECIMATE
static DerivedMesh *applyModifier(ModifierData *UNUSED(md), Object *UNUSED(ob), static DerivedMesh *applyModifier(ModifierData *UNUSED(md), Object *UNUSED(ob),
DerivedMesh *derivedData, DerivedMesh *derivedData,
int UNUSED(useRenderParams), ModifierApplyFlag UNUSED(flag))
int UNUSED(isFinalCalc))
{ {
return derivedData; return derivedData;
} }

@ -238,8 +238,7 @@ static void deformVerts(ModifierData *md, Object *ob,
DerivedMesh *derivedData, DerivedMesh *derivedData,
float (*vertexCos)[3], float (*vertexCos)[3],
int numVerts, int numVerts,
int UNUSED(useRenderParams), ModifierApplyFlag UNUSED(flag))
int UNUSED(isFinalCalc))
{ {
DerivedMesh *dm = get_cddm(ob, NULL, derivedData, vertexCos); DerivedMesh *dm = get_cddm(ob, NULL, derivedData, vertexCos);

@ -103,8 +103,7 @@ static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md)
static DerivedMesh *applyModifier(ModifierData *md, Object *ob, static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
DerivedMesh *dm, DerivedMesh *dm,
int UNUSED(useRenderParams), ModifierApplyFlag UNUSED(flag))
int UNUSED(isFinalCalc))
{ {
DynamicPaintModifierData *pmd = (DynamicPaintModifierData *) md; DynamicPaintModifierData *pmd = (DynamicPaintModifierData *) md;

@ -140,9 +140,8 @@ static DerivedMesh *edgesplitModifier_do(EdgeSplitModifierData *emd,
return doEdgeSplit(dm, emd, ob); return doEdgeSplit(dm, emd, ob);
} }
static DerivedMesh *applyModifier( static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *derivedData,
ModifierData *md, Object *ob, DerivedMesh *derivedData, ModifierApplyFlag UNUSED(flag))
int UNUSED(useRenderParams), int UNUSED(isFinalCalc))
{ {
DerivedMesh *result; DerivedMesh *result;
EdgeSplitModifierData *emd = (EdgeSplitModifierData *) md; EdgeSplitModifierData *emd = (EdgeSplitModifierData *) md;
@ -159,7 +158,7 @@ static DerivedMesh *applyModifierEM(ModifierData *md, Object *ob,
struct BMEditMesh *UNUSED(editData), struct BMEditMesh *UNUSED(editData),
DerivedMesh *derivedData) DerivedMesh *derivedData)
{ {
return applyModifier(md, ob, derivedData, 0, 1); return applyModifier(md, ob, derivedData, MOD_APPLY_USECACHE);
} }

@ -991,8 +991,7 @@ static ParticleSystemModifierData *findPrecedingParticlesystem(Object *ob, Modif
} }
static DerivedMesh *applyModifier(ModifierData *md, Object *ob, static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
DerivedMesh *derivedData, DerivedMesh *derivedData,
int UNUSED(useRenderParams), ModifierApplyFlag UNUSED(flag))
int UNUSED(isFinalCalc))
{ {
DerivedMesh *dm = derivedData; DerivedMesh *dm = derivedData;
ExplodeModifierData *emd = (ExplodeModifierData *) md; ExplodeModifierData *emd = (ExplodeModifierData *) md;

@ -78,8 +78,7 @@ static void copyData(ModifierData *md, ModifierData *target)
static DerivedMesh *applyModifier(ModifierData *md, Object *ob, static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
DerivedMesh *dm, DerivedMesh *dm,
int useRenderParams, ModifierApplyFlag flag)
int isFinalCalc)
{ {
FluidsimModifierData *fluidmd = (FluidsimModifierData *) md; FluidsimModifierData *fluidmd = (FluidsimModifierData *) md;
DerivedMesh *result = NULL; 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; return result ? result : dm;
} }

@ -246,7 +246,7 @@ static void deformVerts_do(HookModifierData *hmd, Object *ob, DerivedMesh *dm,
static void deformVerts(ModifierData *md, Object *ob, DerivedMesh *derivedData, static void deformVerts(ModifierData *md, Object *ob, DerivedMesh *derivedData,
float (*vertexCos)[3], int numVerts, float (*vertexCos)[3], int numVerts,
int UNUSED(useRenderParams), int UNUSED(isFinalCalc)) ModifierApplyFlag UNUSED(flag))
{ {
HookModifierData *hmd = (HookModifierData *) md; HookModifierData *hmd = (HookModifierData *) md;
DerivedMesh *dm = derivedData; DerivedMesh *dm = derivedData;

@ -110,8 +110,7 @@ static void deformVerts(ModifierData *md, Object *ob,
DerivedMesh *derivedData, DerivedMesh *derivedData,
float (*vertexCos)[3], float (*vertexCos)[3],
int numVerts, int numVerts,
int UNUSED(useRenderParams), ModifierApplyFlag UNUSED(flag))
int UNUSED(isFinalCalc))
{ {
LatticeModifierData *lmd = (LatticeModifierData *) md; LatticeModifierData *lmd = (LatticeModifierData *) md;
@ -130,7 +129,7 @@ static void deformVertsEM(
if (!derivedData) dm = CDDM_from_BMEditMesh(editData, ob->data, FALSE, FALSE); 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); if (!derivedData) dm->release(dm);
} }

@ -94,8 +94,7 @@ static void updateDepgraph(ModifierData *md, DagForest *forest,
static DerivedMesh *applyModifier(ModifierData *md, Object *ob, static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
DerivedMesh *derivedData, DerivedMesh *derivedData,
int UNUSED(useRenderParams), ModifierApplyFlag UNUSED(flag))
int UNUSED(isFinalCalc))
{ {
MaskModifierData *mmd = (MaskModifierData *)md; MaskModifierData *mmd = (MaskModifierData *)md;
DerivedMesh *dm = derivedData, *result = NULL; DerivedMesh *dm = derivedData, *result = NULL;

@ -341,8 +341,7 @@ static void deformVerts(ModifierData *md, Object *ob,
DerivedMesh *derivedData, DerivedMesh *derivedData,
float (*vertexCos)[3], float (*vertexCos)[3],
int numVerts, int numVerts,
int UNUSED(useRenderParams), ModifierApplyFlag UNUSED(flag))
int UNUSED(isFinalCalc))
{ {
DerivedMesh *dm = get_dm(ob, NULL, derivedData, NULL, 0); DerivedMesh *dm = get_dm(ob, NULL, derivedData, NULL, 0);

@ -322,8 +322,7 @@ static DerivedMesh *mirrorModifier__doMirror(MirrorModifierData *mmd,
static DerivedMesh *applyModifier(ModifierData *md, Object *ob, static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
DerivedMesh *derivedData, DerivedMesh *derivedData,
int UNUSED(useRenderParams), ModifierApplyFlag UNUSED(flag))
int UNUSED(isFinalCalc))
{ {
DerivedMesh *result; DerivedMesh *result;
MirrorModifierData *mmd = (MirrorModifierData *) md; MirrorModifierData *mmd = (MirrorModifierData *) md;
@ -340,7 +339,7 @@ static DerivedMesh *applyModifierEM(ModifierData *md, Object *ob,
struct BMEditMesh *UNUSED(editData), struct BMEditMesh *UNUSED(editData),
DerivedMesh *derivedData) DerivedMesh *derivedData)
{ {
return applyModifier(md, ob, derivedData, 0, 1); return applyModifier(md, ob, derivedData, MOD_APPLY_USECACHE);
} }

@ -71,11 +71,12 @@ static void copyData(ModifierData *md, ModifierData *target)
} }
static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *dm, static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *dm,
int useRenderParams, int isFinalCalc) ModifierApplyFlag flag)
{ {
MultiresModifierData *mmd = (MultiresModifierData *)md; MultiresModifierData *mmd = (MultiresModifierData *)md;
DerivedMesh *result; DerivedMesh *result;
Mesh *me = (Mesh *)ob->data; Mesh *me = (Mesh *)ob->data;
const int useRenderParams = flag & MOD_APPLY_RENDER;
if (mmd->totlvl) { if (mmd->totlvl) {
if (!CustomData_get_layer(&me->ldata, CD_MDISPS)) { if (!CustomData_get_layer(&me->ldata, CD_MDISPS)) {
@ -89,7 +90,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *dm,
if (result == dm) if (result == dm)
return dm; return dm;
if (useRenderParams || !isFinalCalc) { if(useRenderParams || !(flag & MOD_APPLY_USECACHE)) {
DerivedMesh *cddm; DerivedMesh *cddm;
cddm = CDDM_copy(result); cddm = CDDM_copy(result);

@ -536,8 +536,7 @@ static DerivedMesh *doOcean(ModifierData *md, Object *UNUSED(ob),
static DerivedMesh *applyModifier(ModifierData *md, Object *ob, static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
DerivedMesh *derivedData, DerivedMesh *derivedData,
int UNUSED(useRenderParams), ModifierApplyFlag UNUSED(flag))
int UNUSED(isFinalCalc))
{ {
DerivedMesh *result; DerivedMesh *result;
@ -553,7 +552,7 @@ static DerivedMesh *applyModifierEM(ModifierData *md, Object *ob,
struct BMEditMesh *UNUSED(editData), struct BMEditMesh *UNUSED(editData),
DerivedMesh *derivedData) DerivedMesh *derivedData)
{ {
return applyModifier(md, ob, derivedData, 0, 1); return applyModifier(md, ob, derivedData, MOD_APPLY_USECACHE);
} }

@ -107,8 +107,7 @@ static void foreachObjectLink(ModifierData *md, Object *ob,
static DerivedMesh *applyModifier(ModifierData *md, Object *ob, static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
DerivedMesh *derivedData, DerivedMesh *derivedData,
int UNUSED(useRenderParams), ModifierApplyFlag UNUSED(flag))
int UNUSED(isFinalCalc))
{ {
DerivedMesh *dm = derivedData, *result; DerivedMesh *dm = derivedData, *result;
ParticleInstanceModifierData *pimd = (ParticleInstanceModifierData *) md; ParticleInstanceModifierData *pimd = (ParticleInstanceModifierData *) md;
@ -330,7 +329,7 @@ static DerivedMesh *applyModifierEM(ModifierData *md, Object *ob,
struct BMEditMesh *UNUSED(editData), struct BMEditMesh *UNUSED(editData),
DerivedMesh *derivedData) DerivedMesh *derivedData)
{ {
return applyModifier(md, ob, derivedData, 0, 1); return applyModifier(md, ob, derivedData, MOD_APPLY_USECACHE);
} }

@ -124,8 +124,7 @@ static void deformVerts(ModifierData *md, Object *ob,
DerivedMesh *derivedData, DerivedMesh *derivedData,
float (*vertexCos)[3], float (*vertexCos)[3],
int UNUSED(numVerts), int UNUSED(numVerts),
int UNUSED(useRenderParams), ModifierApplyFlag UNUSED(flag))
int UNUSED(isFinalCalc))
{ {
DerivedMesh *dm = derivedData; DerivedMesh *dm = derivedData;
ParticleSystemModifierData *psmd = (ParticleSystemModifierData *) md; ParticleSystemModifierData *psmd = (ParticleSystemModifierData *) md;

@ -147,8 +147,7 @@ static void dualcon_add_quad(void *output_v, const int vert_indices[4])
static DerivedMesh *applyModifier(ModifierData *md, static DerivedMesh *applyModifier(ModifierData *md,
Object *UNUSED(ob), Object *UNUSED(ob),
DerivedMesh *dm, DerivedMesh *dm,
int UNUSED(useRenderParams), ModifierApplyFlag UNUSED(flag))
int UNUSED(isFinalCalc))
{ {
RemeshModifierData *rmd; RemeshModifierData *rmd;
DualConOutput *output; DualConOutput *output;
@ -200,8 +199,7 @@ static DerivedMesh *applyModifier(ModifierData *md,
static DerivedMesh *applyModifier(ModifierData *UNUSED(md), Object *UNUSED(ob), static DerivedMesh *applyModifier(ModifierData *UNUSED(md), Object *UNUSED(ob),
DerivedMesh *derivedData, DerivedMesh *derivedData,
int UNUSED(useRenderParams), ModifierApplyFlag UNUSED(flag))
int UNUSED(isFinalCalc))
{ {
return derivedData; return derivedData;
} }

@ -134,12 +134,12 @@ static void copyData(ModifierData *md, ModifierData *target)
static DerivedMesh *applyModifier(ModifierData *md, Object *ob, static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
DerivedMesh *derivedData, DerivedMesh *derivedData,
int useRenderParams, ModifierApplyFlag flag)
int UNUSED(isFinalCalc))
{ {
DerivedMesh *dm = derivedData; DerivedMesh *dm = derivedData;
DerivedMesh *result; DerivedMesh *result;
ScrewModifierData *ltmd = (ScrewModifierData *) md; ScrewModifierData *ltmd = (ScrewModifierData *) md;
const int useRenderParams = flag & MOD_APPLY_RENDER;
int *origindex; int *origindex;
int mpoly_index = 0; int mpoly_index = 0;
@ -940,7 +940,7 @@ static DerivedMesh *applyModifierEM(
struct BMEditMesh *UNUSED(editData), struct BMEditMesh *UNUSED(editData),
DerivedMesh *derivedData) DerivedMesh *derivedData)
{ {
return applyModifier(md, ob, derivedData, 0, 1); return applyModifier(md, ob, derivedData, MOD_APPLY_USECACHE);
} }
static int dependsOnTime(ModifierData *UNUSED(md)) static int dependsOnTime(ModifierData *UNUSED(md))

@ -52,8 +52,7 @@ static void deformVerts(ModifierData *md, Object *ob,
DerivedMesh *UNUSED(derivedData), DerivedMesh *UNUSED(derivedData),
float (*vertexCos)[3], float (*vertexCos)[3],
int numVerts, int numVerts,
int UNUSED(useRenderParams), ModifierApplyFlag UNUSED(flag))
int UNUSED(isFinalCalc))
{ {
KeyBlock *kb = ob_get_keyblock(ob); KeyBlock *kb = ob_get_keyblock(ob);
float (*deformedVerts)[3]; float (*deformedVerts)[3];
@ -86,7 +85,7 @@ static void deformMatrices(ModifierData *md, Object *ob, DerivedMesh *derivedDat
copy_m3_m3(defMats[a], scale); 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, static void deformVertsEM(ModifierData *md, Object *ob,
@ -98,7 +97,7 @@ static void deformVertsEM(ModifierData *md, Object *ob,
Key *key = ob_get_key(ob); Key *key = ob_get_key(ob);
if (key && key->type == KEY_RELATIVE) 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, static void deformMatricesEM(ModifierData *UNUSED(md), Object *ob,

@ -114,8 +114,7 @@ static void deformVerts(ModifierData *md, Object *ob,
DerivedMesh *derivedData, DerivedMesh *derivedData,
float (*vertexCos)[3], float (*vertexCos)[3],
int numVerts, int numVerts,
int UNUSED(useRenderParams), ModifierApplyFlag UNUSED(flag))
int UNUSED(isFinalCalc))
{ {
DerivedMesh *dm = derivedData; DerivedMesh *dm = derivedData;
CustomDataMask dataMask = requiredDataMask(ob, md); CustomDataMask dataMask = requiredDataMask(ob, md);

@ -307,8 +307,7 @@ static void deformVerts(ModifierData *md, Object *ob,
DerivedMesh *derivedData, DerivedMesh *derivedData,
float (*vertexCos)[3], float (*vertexCos)[3],
int numVerts, int numVerts,
int UNUSED(useRenderParams), ModifierApplyFlag UNUSED(flag))
int UNUSED(isFinalCalc))
{ {
DerivedMesh *dm = derivedData; DerivedMesh *dm = derivedData;
CustomDataMask dataMask = requiredDataMask(ob, md); CustomDataMask dataMask = requiredDataMask(ob, md);

@ -85,8 +85,7 @@ static void deformVerts(ModifierData *md, Object *ob,
DerivedMesh *derivedData, DerivedMesh *derivedData,
float (*vertexCos)[3], float (*vertexCos)[3],
int UNUSED(numVerts), int UNUSED(numVerts),
int UNUSED(useRenderParams), ModifierApplyFlag UNUSED(flag))
int UNUSED(isFinalCalc))
{ {
SmokeModifierData *smd = (SmokeModifierData *) md; SmokeModifierData *smd = (SmokeModifierData *) md;
DerivedMesh *dm = get_cddm(ob, NULL, derivedData, vertexCos); DerivedMesh *dm = get_cddm(ob, NULL, derivedData, vertexCos);

@ -212,9 +212,8 @@ static void smoothModifier_do(
MEM_freeN(uctmp); MEM_freeN(uctmp);
} }
static void deformVerts( static void deformVerts(ModifierData *md, Object *ob, DerivedMesh *derivedData,
ModifierData *md, Object *ob, DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts, ModifierApplyFlag UNUSED(flag))
float (*vertexCos)[3], int numVerts, int UNUSED(useRenderParams), int UNUSED(isFinalCalc))
{ {
DerivedMesh *dm = get_dm(ob, NULL, derivedData, NULL, 0); DerivedMesh *dm = get_dm(ob, NULL, derivedData, NULL, 0);

@ -48,8 +48,7 @@ static void deformVerts(ModifierData *md, Object *ob,
DerivedMesh *UNUSED(derivedData), DerivedMesh *UNUSED(derivedData),
float (*vertexCos)[3], float (*vertexCos)[3],
int numVerts, int numVerts,
int UNUSED(useRenderParams), ModifierApplyFlag UNUSED(flag))
int UNUSED(isFinalCalc))
{ {
sbObjectStep(md->scene, ob, (float)md->scene->r.cfra, vertexCos, numVerts); sbObjectStep(md->scene, ob, (float)md->scene->r.cfra, vertexCos, numVerts);
} }

@ -204,8 +204,7 @@ static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md)
static DerivedMesh *applyModifier(ModifierData *md, Object *ob, static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
DerivedMesh *dm, DerivedMesh *dm,
int UNUSED(useRenderParams), ModifierApplyFlag UNUSED(flag))
int UNUSED(isFinalCalc))
{ {
int i; int i;
DerivedMesh *result; DerivedMesh *result;
@ -753,7 +752,7 @@ static DerivedMesh *applyModifierEM(ModifierData *md,
struct BMEditMesh *UNUSED(editData), struct BMEditMesh *UNUSED(editData),
DerivedMesh *derivedData) DerivedMesh *derivedData)
{ {
return applyModifier(md, ob, derivedData, 0, 1); return applyModifier(md, ob, derivedData, MOD_APPLY_USECACHE);
} }

@ -91,14 +91,15 @@ static int isDisabled(ModifierData *md, int useRenderParams)
static DerivedMesh *applyModifier(ModifierData *md, Object *ob, static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
DerivedMesh *derivedData, DerivedMesh *derivedData,
int useRenderParams, ModifierApplyFlag flag)
int isFinalCalc)
{ {
SubsurfModifierData *smd = (SubsurfModifierData *) md; SubsurfModifierData *smd = (SubsurfModifierData *) md;
DerivedMesh *result; DerivedMesh *result;
const int useRenderParams = flag & MOD_APPLY_RENDER;
const int isFinalCalc = flag & MOD_APPLY_USECACHE;
result = subsurf_make_derived_from_derived(derivedData, smd, result = subsurf_make_derived_from_derived(derivedData, smd, useRenderParams, NULL,
useRenderParams, NULL, isFinalCalc, 0, (ob->flag & OB_MODE_EDIT)); isFinalCalc, 0, (ob->flag & OB_MODE_EDIT));
if (useRenderParams || !isFinalCalc) { if (useRenderParams || !isFinalCalc) {
DerivedMesh *cddm = CDDM_copy(result); DerivedMesh *cddm = CDDM_copy(result);

@ -89,8 +89,7 @@ static void deformVerts(ModifierData *md, Object *ob,
DerivedMesh *derivedData, DerivedMesh *derivedData,
float (*vertexCos)[3], float (*vertexCos)[3],
int UNUSED(numVerts), int UNUSED(numVerts),
int UNUSED(useRenderParams), ModifierApplyFlag UNUSED(flag))
int UNUSED(isFinalCalc))
{ {
SurfaceModifierData *surmd = (SurfaceModifierData *) md; SurfaceModifierData *surmd = (SurfaceModifierData *) md;

@ -390,8 +390,7 @@ static DerivedMesh *uvprojectModifier_do(UVProjectModifierData *umd,
static DerivedMesh *applyModifier(ModifierData *md, Object *ob, static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
DerivedMesh *derivedData, DerivedMesh *derivedData,
int UNUSED(useRenderParams), ModifierApplyFlag UNUSED(flag))
int UNUSED(isFinalCalc))
{ {
DerivedMesh *result; DerivedMesh *result;
UVProjectModifierData *umd = (UVProjectModifierData *) md; UVProjectModifierData *umd = (UVProjectModifierData *) md;
@ -405,7 +404,7 @@ static DerivedMesh *applyModifierEM(ModifierData *md, Object *ob,
struct BMEditMesh *UNUSED(editData), struct BMEditMesh *UNUSED(editData),
DerivedMesh *derivedData) DerivedMesh *derivedData)
{ {
return applyModifier(md, ob, derivedData, 0, 1); return applyModifier(md, ob, derivedData, MOD_APPLY_USECACHE);
} }

@ -317,7 +317,7 @@ static int warp_needs_dm(WarpModifierData *wmd)
} }
static void deformVerts(ModifierData *md, Object *ob, DerivedMesh *derivedData, 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; DerivedMesh *dm = NULL;
int use_dm = warp_needs_dm((WarpModifierData *)md); 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); 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 (use_dm) {
if (!derivedData) dm->release(dm); if (!derivedData) dm->release(dm);

@ -327,8 +327,7 @@ static void deformVerts(ModifierData *md, Object *ob,
DerivedMesh *derivedData, DerivedMesh *derivedData,
float (*vertexCos)[3], float (*vertexCos)[3],
int numVerts, int numVerts,
int UNUSED(useRenderParams), ModifierApplyFlag UNUSED(flag))
int UNUSED(isFinalCalc))
{ {
DerivedMesh *dm = derivedData; DerivedMesh *dm = derivedData;
WaveModifierData *wmd = (WaveModifierData *)md; WaveModifierData *wmd = (WaveModifierData *)md;

@ -176,7 +176,7 @@ static int isDisabled(ModifierData *md, int UNUSED(useRenderParams))
} }
static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *derivedData, static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *derivedData,
int UNUSED(useRenderParams), int UNUSED(isFinalCalc)) ModifierApplyFlag UNUSED(flag))
{ {
WeightVGEditModifierData *wmd = (WeightVGEditModifierData *) md; WeightVGEditModifierData *wmd = (WeightVGEditModifierData *) md;
DerivedMesh *dm = derivedData; DerivedMesh *dm = derivedData;
@ -271,7 +271,7 @@ static DerivedMesh *applyModifierEM(ModifierData *md, Object *ob,
struct BMEditMesh *UNUSED(editData), struct BMEditMesh *UNUSED(editData),
DerivedMesh *derivedData) DerivedMesh *derivedData)
{ {
return applyModifier(md, ob, derivedData, 0, 1); return applyModifier(md, ob, derivedData, MOD_APPLY_USECACHE);
} }

@ -218,7 +218,7 @@ static int isDisabled(ModifierData *md, int UNUSED(useRenderParams))
} }
static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *derivedData, static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *derivedData,
int UNUSED(useRenderParams), int UNUSED(isFinalCalc)) ModifierApplyFlag UNUSED(flag))
{ {
WeightVGMixModifierData *wmd = (WeightVGMixModifierData *) md; WeightVGMixModifierData *wmd = (WeightVGMixModifierData *) md;
DerivedMesh *dm = derivedData; DerivedMesh *dm = derivedData;
@ -402,7 +402,7 @@ static DerivedMesh *applyModifierEM(ModifierData *md, Object *ob,
struct BMEditMesh *UNUSED(editData), struct BMEditMesh *UNUSED(editData),
DerivedMesh *derivedData) DerivedMesh *derivedData)
{ {
return applyModifier(md, ob, derivedData, 0, 1); return applyModifier(md, ob, derivedData, MOD_APPLY_USECACHE);
} }

@ -338,7 +338,7 @@ static int isDisabled(ModifierData *md, int UNUSED(useRenderParams))
} }
static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *derivedData, static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *derivedData,
int UNUSED(useRenderParams), int UNUSED(isFinalCalc)) ModifierApplyFlag UNUSED(flag))
{ {
WeightVGProximityModifierData *wmd = (WeightVGProximityModifierData *) md; WeightVGProximityModifierData *wmd = (WeightVGProximityModifierData *) md;
DerivedMesh *dm = derivedData; DerivedMesh *dm = derivedData;
@ -537,7 +537,7 @@ static DerivedMesh *applyModifierEM(ModifierData *md, Object *ob,
struct BMEditMesh *UNUSED(editData), struct BMEditMesh *UNUSED(editData),
DerivedMesh *derivedData) DerivedMesh *derivedData)
{ {
return applyModifier(md, ob, derivedData, 0, 1); return applyModifier(md, ob, derivedData, MOD_APPLY_USECACHE);
} }