Fix #21369: normals on extruded text and curve objects were flipped
for the backside, giving problems with e.g. boolean operations.
This commit is contained in:
@@ -99,7 +99,7 @@ extern void shadeMeshMCol(struct Scene *scene, struct Object *ob, struct Mesh *m
|
||||
int surfindex_displist(DispList *dl, int a, int *b, int *p1, int *p2, int *p3, int *p4);
|
||||
void imagestodisplist(void);
|
||||
void reshadeall_displist(struct Scene *scene);
|
||||
void filldisplist(struct ListBase *dispbase, struct ListBase *to);
|
||||
void filldisplist(struct ListBase *dispbase, struct ListBase *to, int flipnormal);
|
||||
|
||||
void fastshade_free_render(void);
|
||||
|
||||
|
||||
@@ -925,7 +925,7 @@ static void curve_to_displist(Curve *cu, ListBase *nubase, ListBase *dispbase)
|
||||
}
|
||||
|
||||
|
||||
void filldisplist(ListBase *dispbase, ListBase *to)
|
||||
void filldisplist(ListBase *dispbase, ListBase *to, int flipnormal)
|
||||
{
|
||||
EditVert *eve, *v1, *vlast;
|
||||
EditFace *efa;
|
||||
@@ -1019,6 +1019,9 @@ void filldisplist(ListBase *dispbase, ListBase *to)
|
||||
index[0]= (intptr_t)efa->v1->tmp.l;
|
||||
index[1]= (intptr_t)efa->v2->tmp.l;
|
||||
index[2]= (intptr_t)efa->v3->tmp.l;
|
||||
|
||||
if(flipnormal)
|
||||
SWAP(int, index[0], index[2]);
|
||||
|
||||
index+= 3;
|
||||
efa= efa->next;
|
||||
@@ -1095,13 +1098,13 @@ static void bevels_to_filledpoly(Curve *cu, ListBase *dispbase)
|
||||
dl= dl->next;
|
||||
}
|
||||
|
||||
filldisplist(&front, dispbase);
|
||||
filldisplist(&back, dispbase);
|
||||
filldisplist(&front, dispbase, 1);
|
||||
filldisplist(&back, dispbase, 0);
|
||||
|
||||
freedisplist(&front);
|
||||
freedisplist(&back);
|
||||
|
||||
filldisplist(dispbase, dispbase);
|
||||
filldisplist(dispbase, dispbase, 0);
|
||||
|
||||
}
|
||||
|
||||
@@ -1113,7 +1116,7 @@ static void curve_to_filledpoly(Curve *cu, ListBase *nurb, ListBase *dispbase)
|
||||
bevels_to_filledpoly(cu, dispbase);
|
||||
}
|
||||
else {
|
||||
filldisplist(dispbase, dispbase);
|
||||
filldisplist(dispbase, dispbase, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1315,7 +1318,7 @@ static void curve_calc_modifiers_post(Scene *scene, Object *ob, ListBase *dispba
|
||||
ModifierData *preTesselatePoint;
|
||||
Curve *cu= ob->data;
|
||||
ListBase *nurb= cu->editnurb?cu->editnurb:&cu->nurb;
|
||||
int required_mode, totvert;
|
||||
int required_mode, totvert = 0;
|
||||
int editmode = (!forRender && cu->editnurb);
|
||||
DerivedMesh *dm= NULL, *ndm;
|
||||
float (*vertCos)[3] = NULL;
|
||||
|
||||
@@ -186,7 +186,7 @@ static void draw_triangulated(short mcords[][2], short tot)
|
||||
}
|
||||
|
||||
/* do the fill */
|
||||
filldisplist(&lb, &lb);
|
||||
filldisplist(&lb, &lb, 0);
|
||||
|
||||
/* do the draw */
|
||||
dl= lb.first; /* filldisplist adds in head of list */
|
||||
|
||||
@@ -419,7 +419,7 @@ static PyObject *M_Geometry_PolyFill( PyObject * self, PyObject * polyLineSeq )
|
||||
}
|
||||
else if (totpoints) {
|
||||
/* now make the list to return */
|
||||
filldisplist(&dispbase, &dispbase);
|
||||
filldisplist(&dispbase, &dispbase, 0);
|
||||
|
||||
/* The faces are stored in a new DisplayList
|
||||
thats added to the head of the listbase */
|
||||
|
||||
Reference in New Issue
Block a user