diff options
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/modifiers/intern/MOD_cast.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/source/blender/modifiers/intern/MOD_cast.c b/source/blender/modifiers/intern/MOD_cast.c index 74e19f3254a..959f77b0718 100644 --- a/source/blender/modifiers/intern/MOD_cast.c +++ b/source/blender/modifiers/intern/MOD_cast.c @@ -429,9 +429,13 @@ static void deformVerts( int numVerts) { CastModifierData *cmd = (CastModifierData *)md; - Mesh *mesh_src = MOD_get_mesh_eval(ctx->object, NULL, mesh, NULL, false, false); + Mesh *mesh_src = NULL; - BLI_assert(mesh_src->totvert == 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 (cmd->type == MOD_CAST_TYPE_CUBOID) { cuboid_do(cmd, ctx->object, mesh_src, vertexCos, numVerts); @@ -440,7 +444,7 @@ static void deformVerts( sphere_do(cmd, ctx->object, mesh_src, vertexCos, numVerts); } - if (mesh_src != mesh) { + if (!ELEM(mesh_src, NULL, mesh)) { BKE_id_free(NULL, mesh_src); } } |