Suppress assert for meshes with no faces

This commit is contained in:
Campbell Barton 2017-06-02 16:42:39 +10:00
parent 678a6b6c49
commit f8ea2c92db
Notes: blender-bot 2023-02-14 07:25:51 +01:00
Referenced by issue #51694, Tangent related crash (assert) when deleting all verts in Eevee
1 changed files with 3 additions and 1 deletions

View File

@ -538,7 +538,9 @@ static MeshRenderData *mesh_render_data_create(Mesh *me, const int types)
/* note: BKE_editmesh_loop_tangent_calc calculates 'CD_TANGENT',
* not 'CD_MLOOPTANGENT' (as done below). It's OK, they're compatible. */
rdata->cd.layers.tangent[i] = CustomData_get_layer_n(&rdata->cd.output.ldata, CD_TANGENT, i);
BLI_assert(rdata->cd.layers.tangent[i] != NULL);
if (rdata->tri_len != 0) {
BLI_assert(rdata->cd.layers.tangent[i] != NULL);
}
}
}