diff options
author | Ton Roosendaal <ton@blender.org> | 2004-10-31 00:46:10 +0400 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2004-10-31 00:46:10 +0400 |
commit | d292541cac01daf267fc693b3873ad254dfe4007 (patch) | |
tree | fedc1c42579c2c13ed5ca6015ad3f4038699f2b0 /source | |
parent | 9968d2b5bab218559107839b29a179799ad1c3dd (diff) |
For solid display of curves in editmode; found fix (thnx intrr :) that
hopefully prevents weird results in grabber... error was that the
editNurb was not used for triangulating.
Also; added drawing the wire as extra in solid display editing curves...
that for unfilled curves as well.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/BKE_displist.h | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/displist.c | 4 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/mesh.c | 2 | ||||
-rw-r--r-- | source/blender/renderconverter/intern/convertBlenderScene.c | 2 | ||||
-rw-r--r-- | source/blender/src/drawobject.c | 32 |
5 files changed, 27 insertions, 15 deletions
diff --git a/source/blender/blenkernel/BKE_displist.h b/source/blender/blenkernel/BKE_displist.h index 803fa63b994..1ba6e8d98a2 100644 --- a/source/blender/blenkernel/BKE_displist.h +++ b/source/blender/blenkernel/BKE_displist.h @@ -116,7 +116,7 @@ extern DispList *find_displist_create(struct ListBase *lb, int type); extern DispList *find_displist(struct ListBase *lb, int type); 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 curve_to_filledpoly(struct Curve *cu, struct ListBase *nurb, 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); diff --git a/source/blender/blenkernel/intern/displist.c b/source/blender/blenkernel/intern/displist.c index a76b991d82c..f1d441a31a3 100644 --- a/source/blender/blenkernel/intern/displist.c +++ b/source/blender/blenkernel/intern/displist.c @@ -1669,7 +1669,7 @@ static void bevels_to_filledpoly(Curve *cu, ListBase *dispbase) } -void curve_to_filledpoly(Curve *cu, ListBase *dispbase) +void curve_to_filledpoly(Curve *cu, ListBase *nurb, ListBase *dispbase) { DispList *dl; Nurb *nu; @@ -1678,7 +1678,7 @@ void curve_to_filledpoly(Curve *cu, ListBase *dispbase) if(cu->flag & CU_3D) return; - nu= cu->nurb.first; + nu= nurb->first; while(nu) { if(nu->flagu & CU_CYCLIC) break; nu= nu->next; diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c index 77524fec239..2703d972323 100644 --- a/source/blender/blenkernel/intern/mesh.c +++ b/source/blender/blenkernel/intern/mesh.c @@ -962,7 +962,7 @@ void nurbs_to_mesh(Object *ob) /* rule: dl->type INDEX3 always as first in list */ dl= cu->disp.first; if(dl->type!=DL_INDEX3) { - curve_to_filledpoly(ob->data, &cu->disp); + curve_to_filledpoly(ob->data, &cu->nurb, &cu->disp); } } diff --git a/source/blender/renderconverter/intern/convertBlenderScene.c b/source/blender/renderconverter/intern/convertBlenderScene.c index 091eb978828..def67ae6155 100644 --- a/source/blender/renderconverter/intern/convertBlenderScene.c +++ b/source/blender/renderconverter/intern/convertBlenderScene.c @@ -2202,7 +2202,7 @@ static void init_render_curve(Object *ob) if(cu->disp.first==0) return; if(dl->type!=DL_INDEX3) { - curve_to_filledpoly(cu, &cu->disp); + curve_to_filledpoly(cu, &cu->nurb, &cu->disp); } if(cu->bev.first==0) makeBevelList(ob); diff --git a/source/blender/src/drawobject.c b/source/blender/src/drawobject.c index a99fe621260..38b3a8396d5 100644 --- a/source/blender/src/drawobject.c +++ b/source/blender/src/drawobject.c @@ -2153,6 +2153,7 @@ static void drawDispList(Object *ob, int dt) ListBase *lb=0; DispList *dl; Mesh *me; + Curve *cu; int solid; @@ -2269,8 +2270,9 @@ static void drawDispList(Object *ob, int dt) case OB_FONT: case OB_CURVE: - - lb= &((Curve *)ob->data)->disp; + cu= ob->data; + + lb= &cu->disp; if(lb->first==0) makeDispList(ob); if(solid) { @@ -2279,7 +2281,9 @@ static void drawDispList(Object *ob, int dt) /* rule: dl->type INDEX3 is always first in list */ if(dl->type!=DL_INDEX3) { - curve_to_filledpoly(ob->data, lb); + if(ob==G.obedit) curve_to_filledpoly(ob->data, &editNurb, lb); + else curve_to_filledpoly(ob->data, &cu->nurb, lb); + dl= lb->first; } if(dl->nors==0) addnormalsDispList(ob, lb); @@ -2291,14 +2295,22 @@ static void drawDispList(Object *ob, int dt) drawDispListwire(lb); draw_index_wire= 1; } - else if(dt==OB_SHADED) { - if(ob->disp.first==0) shadeDispList(ob); - drawDispListshaded(lb, ob); - } else { - init_gl_materials(ob); - two_sided(0); - drawDispListsolid(lb, ob); + if(dt==OB_SHADED) { + if(ob->disp.first==0) shadeDispList(ob); + drawDispListshaded(lb, ob); + } + else { + init_gl_materials(ob); + two_sided(0); + drawDispListsolid(lb, ob); + } + if(ob==G.obedit) { + cpack(0); + draw_index_wire= 0; + drawDispListwire(lb); + draw_index_wire= 1; + } } index3_nors_incr= 1; } |