diff options
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/BKE_modifier.h | 7 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/DerivedMesh.c | 12 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/displist.c | 6 |
3 files changed, 15 insertions, 10 deletions
diff --git a/source/blender/blenkernel/BKE_modifier.h b/source/blender/blenkernel/BKE_modifier.h index cf79aaff55c..955df65d00d 100644 --- a/source/blender/blenkernel/BKE_modifier.h +++ b/source/blender/blenkernel/BKE_modifier.h @@ -111,7 +111,9 @@ typedef void (*TexWalkFunc)(void *userData, struct Object *ob, struct ModifierDa typedef enum ModifierApplyFlag { MOD_APPLY_RENDER = 1 << 0, /* Render time. */ - MOD_APPLY_USECACHE = 1 << 1, /* Final result. Is not set for temporary calculations like orco dms. */ + MOD_APPLY_USECACHE = 1 << 1, /* Result of evaluation will be cached, so modifier might + * want to cache data for quick updates (used by subsurf) */ + MOD_APPLY_ORCO = 1 << 2 /* Modifier evaluated for undeformed texture coordinates */ } ModifierApplyFlag; @@ -200,7 +202,8 @@ typedef struct ModifierTypeInfo { */ struct DerivedMesh *(*applyModifierEM)(struct ModifierData *md, struct Object *ob, struct BMEditMesh *editData, - struct DerivedMesh *derivedData); + struct DerivedMesh *derivedData, + ModifierApplyFlag flag); /********************* Optional functions *********************/ diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c index e188a7b403b..ebe032ad827 100644 --- a/source/blender/blenkernel/intern/DerivedMesh.c +++ b/source/blender/blenkernel/intern/DerivedMesh.c @@ -1692,7 +1692,7 @@ static void mesh_calc_modifiers(Scene *scene, Object *ob, float (*inputVertexCos DM_set_only_copy(orcodm, nextmask | CD_MASK_ORIGINDEX | (mti->requiredDataMask ? mti->requiredDataMask(ob, md) : 0)); - ndm = mti->applyModifier(md, ob, orcodm, app_flags & ~MOD_APPLY_USECACHE); + ndm = mti->applyModifier(md, ob, orcodm, (app_flags & ~MOD_APPLY_USECACHE) | MOD_APPLY_ORCO); if (ndm) { /* if the modifier returned a new dm, release the old one */ @@ -1708,7 +1708,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, app_flags & ~MOD_APPLY_USECACHE); + ndm = mti->applyModifier(md, ob, clothorcodm, (app_flags & ~MOD_APPLY_USECACHE) | MOD_APPLY_ORCO); if (ndm) { /* if the modifier returned a new dm, release the old one */ @@ -2031,9 +2031,9 @@ static void editbmesh_calc_modifiers(Scene *scene, Object *ob, BMEditMesh *em, D DM_set_only_copy(orcodm, mask | CD_MASK_ORIGINDEX); if (mti->applyModifierEM) - ndm = mti->applyModifierEM(md, ob, em, orcodm); + ndm = mti->applyModifierEM(md, ob, em, orcodm, MOD_APPLY_ORCO); else - ndm = mti->applyModifier(md, ob, orcodm, 0); + ndm = mti->applyModifier(md, ob, orcodm, MOD_APPLY_ORCO); if (ndm) { /* if the modifier returned a new dm, release the old one */ @@ -2055,9 +2055,9 @@ static void editbmesh_calc_modifiers(Scene *scene, Object *ob, BMEditMesh *em, D } if (mti->applyModifierEM) - ndm = mti->applyModifierEM(md, ob, em, dm); + ndm = mti->applyModifierEM(md, ob, em, dm, MOD_APPLY_USECACHE); else - ndm = mti->applyModifier(md, ob, dm, 0); + ndm = mti->applyModifier(md, ob, dm, MOD_APPLY_USECACHE); if (ndm) { if (dm && dm != ndm) diff --git a/source/blender/blenkernel/intern/displist.c b/source/blender/blenkernel/intern/displist.c index b47b404dfe0..97923d23fb1 100644 --- a/source/blender/blenkernel/intern/displist.c +++ b/source/blender/blenkernel/intern/displist.c @@ -1132,10 +1132,12 @@ static void curve_calc_orcodm(Scene *scene, Object *ob, DerivedMesh *derivedFina int required_mode; int editmode = (!forRender && (cu->editnurb || cu->editfont)); DerivedMesh *ndm, *orcodm = NULL; - const ModifierApplyFlag app_flag = renderResolution ? MOD_APPLY_RENDER : 0; + ModifierApplyFlag app_flag = MOD_APPLY_ORCO; - if (renderResolution) + if (renderResolution) { + app_flag |= MOD_APPLY_RENDER; required_mode = eModifierMode_Render; + } else required_mode = eModifierMode_Realtime; |