Fix assert displaying UV's of faceless meshes

This commit is contained in:
Campbell Barton 2018-08-27 17:32:14 +10:00
parent 4498fbeb2e
commit 09e1e2b8ce
1 changed files with 8 additions and 0 deletions

View File

@ -166,6 +166,10 @@ static void draw_uvs_shadow(Object *obedit)
BMEditMesh *em = BKE_editmesh_from_object(obedit);
BMesh *bm = em->bm;
if (bm->totloop == 0) {
return;
}
const int cd_loop_uv_offset = CustomData_get_offset(&bm->ldata, CD_MLOOPUV);
uint pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
@ -634,6 +638,10 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, ViewLayer *view_layer, Obje
}
}
if (bm->totloop == 0) {
return;
}
/* 2. draw colored faces */
if (sima->flag & SI_DRAW_STRETCH) {