From 09e1e2b8ce48f7692b0b3f4425a7bcd7d0bec476 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 27 Aug 2018 17:32:14 +1000 Subject: Fix assert displaying UV's of faceless meshes --- source/blender/editors/uvedit/uvedit_draw.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'source/blender/editors/uvedit/uvedit_draw.c') 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) { -- cgit v1.2.3