Fix T79440: Deform modifiers fail in edit-mode when not first

Lattice, armature & curve only worked when an edit-mesh was passed in,
the mesh argument was being ignored.

Regression in 9f5833798c
This commit is contained in:
Campbell Barton 2020-08-03 17:52:53 +10:00
parent d406edf1ee
commit 8f22feefbc
Notes: blender-bot 2023-02-14 01:11:05 +01:00
Referenced by commit 0e52af097f, Fix T93611: Curve modifier crash in editmode in certain situations
Referenced by issue #79440, Lattice modifier isn't deforming the mesh correctly in edit mode
3 changed files with 18 additions and 3 deletions

View File

@ -165,10 +165,15 @@ static void deformVerts(ModifierData *md,
static void deformVertsEM(ModifierData *md,
const ModifierEvalContext *ctx,
struct BMEditMesh *em,
Mesh *UNUSED(mesh),
Mesh *mesh,
float (*vertexCos)[3],
int numVerts)
{
if (mesh != NULL) {
deformVerts(md, ctx, mesh, vertexCos, numVerts);
return;
}
ArmatureModifierData *amd = (ArmatureModifierData *)md;
MOD_previous_vcos_store(md, vertexCos); /* if next modifier needs original vertices */

View File

@ -150,10 +150,15 @@ static void deformVerts(ModifierData *md,
static void deformVertsEM(ModifierData *md,
const ModifierEvalContext *ctx,
BMEditMesh *em,
Mesh *UNUSED(mesh),
Mesh *mesh,
float (*vertexCos)[3],
int numVerts)
{
if (mesh != NULL) {
deformVerts(md, ctx, mesh, vertexCos, numVerts);
return;
}
CurveModifierData *cmd = (CurveModifierData *)md;
bool use_dverts = false;
int defgrp_index = -1;

View File

@ -130,10 +130,15 @@ static void deformVerts(ModifierData *md,
static void deformVertsEM(ModifierData *md,
const ModifierEvalContext *ctx,
struct BMEditMesh *em,
struct Mesh *UNUSED(mesh),
struct Mesh *mesh,
float (*vertexCos)[3],
int numVerts)
{
if (mesh != NULL) {
deformVerts(md, ctx, mesh, vertexCos, numVerts);
return;
}
LatticeModifierData *lmd = (LatticeModifierData *)md;
MOD_previous_vcos_store(md, vertexCos); /* if next modifier needs original vertices */