forked from bartvdbraak/blender
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.
This commit is contained in:
parent
9968d2b5ba
commit
d292541cac
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user