MOD_simpledeform: do not compute mesh when not needed.
Related to T57972.
This commit is contained in:
parent
c89bb6f165
commit
4543da6ca6
|
@ -385,11 +385,18 @@ static void deformVerts(
|
|||
float (*vertexCos)[3],
|
||||
int numVerts)
|
||||
{
|
||||
Mesh *mesh_src = MOD_get_mesh_eval(ctx->object, NULL, mesh, NULL, false, false);
|
||||
SimpleDeformModifierData *sdmd = (SimpleDeformModifierData *)md;
|
||||
Mesh *mesh_src = NULL;
|
||||
|
||||
SimpleDeformModifier_do((SimpleDeformModifierData *)md, ctx->object, mesh_src, vertexCos, numVerts);
|
||||
if (ctx->object->type == OB_MESH) {
|
||||
/* mesh_src is only needed for vgroups. */
|
||||
mesh_src = MOD_get_mesh_eval(ctx->object, NULL, mesh, NULL, false, false);
|
||||
BLI_assert(mesh_src->totvert == numVerts);
|
||||
}
|
||||
|
||||
if (mesh_src != mesh) {
|
||||
SimpleDeformModifier_do(sdmd, ctx->object, mesh_src, vertexCos, numVerts);
|
||||
|
||||
if (!ELEM(mesh_src, NULL, mesh)) {
|
||||
BKE_id_free(NULL, mesh_src);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue