Fix bad pointer cast when modifier is used on non-mesh object
This commit is contained in:
@@ -99,27 +99,26 @@ static void deformVerts(ModifierData *md, const ModifierEvalContext *ctx,
|
||||
int numVerts)
|
||||
{
|
||||
LatticeModifierData *lmd = (LatticeModifierData *) md;
|
||||
struct Mesh *mesh_src = mesh ? mesh : ctx->object->data;
|
||||
struct Mesh *mesh_src = get_mesh(ctx->object, NULL, mesh, NULL, false, false);
|
||||
|
||||
modifier_vgroup_cache(md, vertexCos); /* if next modifier needs original vertices */
|
||||
|
||||
lattice_deform_verts(lmd->object, ctx->object, mesh_src,
|
||||
vertexCos, numVerts, lmd->name, lmd->strength);
|
||||
}
|
||||
|
||||
if (mesh_src != mesh) {
|
||||
BKE_id_free(NULL, mesh_src);
|
||||
}}
|
||||
|
||||
static void deformVertsEM(
|
||||
ModifierData *md, const ModifierEvalContext *ctx, struct BMEditMesh *em,
|
||||
struct Mesh *mesh, float (*vertexCos)[3], int numVerts)
|
||||
{
|
||||
struct Mesh *mesh_src = mesh;
|
||||
|
||||
if (!mesh) {
|
||||
mesh_src = BKE_bmesh_to_mesh_nomain(em->bm, &(struct BMeshToMeshParams){0});
|
||||
}
|
||||
struct Mesh *mesh_src = get_mesh(ctx->object, em, mesh, NULL, false, false);
|
||||
|
||||
deformVerts(md, ctx, mesh_src, vertexCos, numVerts);
|
||||
|
||||
if (!mesh) {
|
||||
if (mesh_src != mesh) {
|
||||
BKE_id_free(NULL, mesh_src);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user