From 408702009e4315a932d8f7b321f5ef5c7b424f14 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Fri, 29 Oct 2004 15:39:01 +0000 Subject: [PATCH] Finally something new! - in Solid draw mode, curves without faces draw as wireframe now - in Solid draw mode, curves without faces don't get fat outline on select - in Solid draw mode, editing curves shows filled now! --- source/blender/blenkernel/BKE_displist.h | 1 + source/blender/blenkernel/intern/displist.c | 13 +++++++++++++ source/blender/src/drawobject.c | 12 +++++++++--- 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/source/blender/blenkernel/BKE_displist.h b/source/blender/blenkernel/BKE_displist.h index e12bcbdf1b4..803fa63b994 100644 --- a/source/blender/blenkernel/BKE_displist.h +++ b/source/blender/blenkernel/BKE_displist.h @@ -118,6 +118,7 @@ extern void addnormalsDispList(struct Object *ob, struct ListBase *lb); extern void count_displist(struct ListBase *lb, int *totvert, int *totface); extern void curve_to_filledpoly(struct Curve *cu, struct ListBase *dispbase); extern void freedisplist(struct ListBase *lb); +extern int displist_has_faces(struct ListBase *lb); extern float calc_taper(struct Object *taperobj, int cur, int tot); extern void makeDispList(struct Object *ob); extern void set_displist_onlyzero(int val); diff --git a/source/blender/blenkernel/intern/displist.c b/source/blender/blenkernel/intern/displist.c index 9ab1606af1b..a76b991d82c 100644 --- a/source/blender/blenkernel/intern/displist.c +++ b/source/blender/blenkernel/intern/displist.c @@ -397,6 +397,19 @@ DispList *find_displist(ListBase *lb, int type) return 0; } +int displist_has_faces(ListBase *lb) +{ + DispList *dl; + + dl= lb->first; + while(dl) { + if ELEM5(dl->type, DL_INDEX3, DL_INDEX4, DL_SURF, DL_MESH, DL_TRIA) + return 1; + dl= dl->next; + } + return 0; +} + void copy_displist(ListBase *lbn, ListBase *lb) { DispList *dln, *dl; diff --git a/source/blender/src/drawobject.c b/source/blender/src/drawobject.c index aab5be58009..7062521c12d 100644 --- a/source/blender/src/drawobject.c +++ b/source/blender/src/drawobject.c @@ -2273,7 +2273,7 @@ static void drawDispList(Object *ob, int dt) lb= &((Curve *)ob->data)->disp; if(lb->first==0) makeDispList(ob); - if(solid && ob!=G.obedit) { + if(solid) { dl= lb->first; if(dl==0) return; @@ -2286,7 +2286,12 @@ static void drawDispList(Object *ob, int dt) index3_nors_incr= 0; - if(dt==OB_SHADED) { + if( displist_has_faces(lb)==0) { + draw_index_wire= 0; + drawDispListwire(lb); + draw_index_wire= 1; + } + else if(dt==OB_SHADED) { if(ob->disp.first==0) shadeDispList(ob); drawDispListshaded(lb, ob); } @@ -3891,7 +3896,8 @@ static void draw_solid_select(Object *ob) case OB_CURVE: case OB_SURF: cu= ob->data; - if(boundbox_clip(ob->obmat, cu->bb)) drawSolidSelect(ob, &cu->disp); + if(displist_has_faces(&cu->disp)) + if(boundbox_clip(ob->obmat, cu->bb)) drawSolidSelect(ob, &cu->disp); break; case OB_MBALL: drawSolidSelect(ob, &ob->disp);