Fix recent Curve porting: mesh pointer may also be NULL in non-EditMode case.

This commit is contained in:
2018-05-08 11:59:48 +02:00
parent 0cd3412d4c
commit cd5b57b4fc

View File

@@ -122,9 +122,17 @@ static void deformVerts(
{
CurveModifierData *cmd = (CurveModifierData *) md;
Mesh *mesh_src = mesh;
if (mesh_src == NULL) {
mesh_src = ctx->object->data;
}
BLI_assert(mesh_src->totvert == numVerts);
/* silly that defaxis and curve_deform_verts are off by 1
* but leave for now to save having to call do_versions */
curve_deform_verts(cmd->object, ctx->object, mesh, vertexCos, numVerts, cmd->name, cmd->defaxis - 1);
curve_deform_verts(cmd->object, ctx->object, mesh_src, vertexCos, numVerts, cmd->name, cmd->defaxis - 1);
}
static void deformVertsEM(
@@ -141,6 +149,8 @@ static void deformVertsEM(
mesh_src = BKE_bmesh_to_mesh_nomain(em->bm, &(struct BMeshToMeshParams){0});
}
BLI_assert(mesh_src->totvert == numVerts);
deformVerts(md, ctx, mesh_src, vertexCos, numVerts);
if (!mesh) {