Modifiers: pass the ob->data to the modifier if the mesh param is NULL

This enables the modifiers to access things like vertex groups. Care should
be taken to not modifier the mesh itself in this case.
This commit is contained in:
2018-05-08 12:34:01 +02:00
parent 9a79178c2e
commit 002dcd2001
2 changed files with 13 additions and 5 deletions

View File

@@ -109,11 +109,11 @@ static void deformVerts(ModifierData *md, const ModifierEvalContext *ctx,
int numVerts)
{
LatticeModifierData *lmd = (LatticeModifierData *) md;
struct Mesh *mesh_src = mesh ? mesh : ctx->object->data;
modifier_vgroup_cache(md, vertexCos); /* if next modifier needs original vertices */
lattice_deform_verts(lmd->object, ctx->object, mesh,
lattice_deform_verts(lmd->object, ctx->object, mesh_src,
vertexCos, numVerts, lmd->name, lmd->strength);
}