Cleanup: stop using DerivedMesh in mesh cache modifier.

This commit is contained in:
Brecht Van Lommel 2018-08-15 16:21:43 +02:00
parent b262fba5e3
commit 9bac3ffd3f
1 changed files with 13 additions and 11 deletions

View File

@ -36,7 +36,6 @@
#include "BLI_path_util.h"
#include "BLI_math.h"
#include "BKE_DerivedMesh.h"
#include "BKE_scene.h"
#include "BKE_global.h"
#include "BKE_mesh.h"
@ -82,7 +81,7 @@ static bool isDisabled(const struct Scene *UNUSED(scene), ModifierData *md, bool
static void meshcache_do(
MeshCacheModifierData *mcmd, Scene *scene, Object *ob, DerivedMesh *UNUSED(dm),
MeshCacheModifierData *mcmd, Scene *scene, Object *ob,
float (*vertexCos_Real)[3], int numVerts)
{
const bool use_factor = mcmd->factor < 1.0f;
@ -266,24 +265,27 @@ static void meshcache_do(
static void deformVerts(
ModifierData *md, const ModifierEvalContext *ctx,
DerivedMesh *derivedData,
Mesh *UNUSED(mesh),
float (*vertexCos)[3],
int numVerts)
{
MeshCacheModifierData *mcmd = (MeshCacheModifierData *)md;
Scene *scene = DEG_get_evaluated_scene(ctx->depsgraph);
meshcache_do(mcmd, scene, ctx->object, derivedData, vertexCos, numVerts);
meshcache_do(mcmd, scene, ctx->object, vertexCos, numVerts);
}
static void deformVertsEM(
ModifierData *md, const ModifierEvalContext *ctx, struct BMEditMesh *UNUSED(editData),
DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts)
ModifierData *md, const ModifierEvalContext *ctx,
struct BMEditMesh *UNUSED(editData),
Mesh *UNUSED(mesh),
float (*vertexCos)[3],
int numVerts)
{
MeshCacheModifierData *mcmd = (MeshCacheModifierData *)md;
Scene *scene = DEG_get_evaluated_scene(ctx->depsgraph);
meshcache_do(mcmd, scene, ctx->object, derivedData, vertexCos, numVerts);
meshcache_do(mcmd, scene, ctx->object, vertexCos, numVerts);
}
@ -298,16 +300,16 @@ ModifierTypeInfo modifierType_MeshCache = {
/* copyData */ modifier_copyData_generic,
/* deformVerts_DM */ deformVerts,
/* deformVerts_DM */ NULL,
/* deformMatrices_DM */ NULL,
/* deformVertsEM_DM */ deformVertsEM,
/* deformVertsEM_DM */ NULL,
/* deformMatricesEM_DM*/NULL,
/* applyModifier_DM */ NULL,
/* applyModifierEM_DM */NULL,
/* deformVerts */ NULL,
/* deformVerts */ deformVerts,
/* deformMatrices */ NULL,
/* deformVertsEM */ NULL,
/* deformVertsEM */ deformVertsEM,
/* deformMatricesEM */ NULL,
/* applyModifier */ NULL,
/* applyModifierEM */ NULL,