From d149a79ad10c12dd68b87fdc3af695db08635cf8 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Sat, 30 Oct 2004 13:42:49 +0000 Subject: [PATCH] Wybren report #1709: Deleting only-faces from fgon still draws wires hidden in editmode. Added extra: when mesh has no faces, it draws wire in solid view, also doesn't draw the 'fat' outline for selection. --- source/blender/src/drawobject.c | 27 +++++++++++++++------------ source/blender/src/editmesh_lib.c | 6 ++++++ 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/source/blender/src/drawobject.c b/source/blender/src/drawobject.c index 7062521c12d..a99fe621260 100644 --- a/source/blender/src/drawobject.c +++ b/source/blender/src/drawobject.c @@ -3861,19 +3861,22 @@ static void drawSolidSelect(Object *ob, ListBase *lb) if(ob->type==OB_MESH) { /* optimal draw gives ugly outline, so we temporally disable it */ Mesh *me= ob->data; - DispList *dl= me->disp.first; - DispListMesh *dlm=NULL; - short flag= 0; - if(dl && dl->mesh) { - dlm= dl->mesh; - flag= dlm->flag & ME_OPT_EDGES; - dlm->flag &= ~ME_OPT_EDGES; - } - - drawmeshwire(ob); + if(me->totface) { + DispList *dl= me->disp.first; + DispListMesh *dlm=NULL; + short flag= 0; + + if(dl && dl->mesh) { + dlm= dl->mesh; + flag= dlm->flag & ME_OPT_EDGES; + dlm->flag &= ~ME_OPT_EDGES; + } + + drawmeshwire(ob); - if(dlm && flag) dlm->flag |= flag; + if(dlm && flag) dlm->flag |= flag; + } } else drawDispListwire(lb); @@ -4197,7 +4200,7 @@ void draw_object(Base *base) if(ob_from_decimator(ob)) drawDispListwire(&ob->disp); else if(dt==OB_BOUNDBOX) draw_bounding_volume(ob); - else if(dt==OB_WIRE) drawmeshwire(ob); + else if(dt==OB_WIRE || me->totface==0) drawmeshwire(ob); else if(ma && (ma->mode & MA_HALO)) drawmeshwire(ob); else if(me->tface) { if(G.f & G_FACESELECT || G.vd->drawtype==OB_TEXTURE) { diff --git a/source/blender/src/editmesh_lib.c b/source/blender/src/editmesh_lib.c index c3f7a069de7..35c506754f8 100644 --- a/source/blender/src/editmesh_lib.c +++ b/source/blender/src/editmesh_lib.c @@ -1594,6 +1594,12 @@ void EM_fgon_flags(void) BLI_addtail(&em->faces, efa); efa= efan; } + + // remove fgon flags when edge not in fgon (anymore) + for(eed= em->edges.first; eed; eed= eed->next) { + if(eed->fgoni==0) eed->h &= ~EM_FGON; + } + }