[Bf-blender-cvs] [09e1e2b8ce4] blender2.8: Fix assert displaying UV's of faceless meshes

Campbell Barton noreply at git.blender.org
Mon Aug 27 09:50:22 CEST 2018


Commit: 09e1e2b8ce48f7692b0b3f4425a7bcd7d0bec476
Author: Campbell Barton
Date:   Mon Aug 27 17:32:14 2018 +1000
Branches: blender2.8
https://developer.blender.org/rB09e1e2b8ce48f7692b0b3f4425a7bcd7d0bec476

Fix assert displaying UV's of faceless meshes

===================================================================

M	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) {



More information about the Bf-blender-cvs mailing list