diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-08-27 10:32:14 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-08-27 10:33:06 +0300 |
commit | 09e1e2b8ce48f7692b0b3f4425a7bcd7d0bec476 (patch) | |
tree | 1ad79dac8df6ab2fccc00f4c29b4b693562274b0 /source/blender/editors/uvedit/uvedit_draw.c | |
parent | 4498fbeb2e2141dbc4aa375f9b5d250afe9a285f (diff) |
Fix assert displaying UV's of faceless meshes
Diffstat (limited to 'source/blender/editors/uvedit/uvedit_draw.c')
-rw-r--r-- | source/blender/editors/uvedit/uvedit_draw.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/editors/uvedit/uvedit_draw.c b/source/blender/editors/uvedit/uvedit_draw.c index 616f4eac2ad..446e8d66fd0 100644 --- a/source/blender/editors/uvedit/uvedit_draw.c +++ b/source/blender/editors/uvedit/uvedit_draw.c @@ -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) { |