forked from bartvdbraak/blender
- Claims of speed improvement last night were slightly
overrated. Turns out there was a bug in recalc code where in editmode mesh was getting reevaluated all the time (because ob->disp doesn't get built in editmode). This should fix. - Fix some normal calculation/backwards face drawing
This commit is contained in:
parent
3fd3728000
commit
489b38fa40
@ -958,7 +958,8 @@ static void build_mesh_data(Object *ob)
|
||||
{
|
||||
Mesh *me = ob->data;
|
||||
|
||||
if(ob->disp.first==NULL) {
|
||||
/* Inside edit mode mesh modifiers aren't calculated */
|
||||
if(ob->disp.first==NULL && G.obedit!=ob) {
|
||||
if(ob->parent && ob->partype==PARSKEL) makeDispList(ob);
|
||||
else if(ob->parent && ob->parent->type==OB_LATTICE) makeDispList(ob);
|
||||
else if(ob->hooks.first) makeDispList(ob);
|
||||
@ -968,7 +969,7 @@ static void build_mesh_data(Object *ob)
|
||||
if(eff->type==EFF_WAVE) makeDispList(ob);
|
||||
}
|
||||
}
|
||||
if(me->disp.first==NULL && mesh_uses_displist(me)) {
|
||||
if(me->derived==NULL && mesh_uses_displist(me)) {
|
||||
makeDispList(ob);
|
||||
}
|
||||
|
||||
|
@ -767,8 +767,6 @@ static void ccgDM_drawFacesSolid(DerivedMesh *dm, void (*setMaterial)(int)) {
|
||||
CCGFaceIterator *fi= ccgSubSurf_getFaceIterator(ss);
|
||||
int gridSize = ccgSubSurf_getGridSize(ss);
|
||||
|
||||
glEnable(GL_NORMALIZE);
|
||||
|
||||
for (; !ccgFaceIterator_isStopped(fi); ccgFaceIterator_next(fi)) {
|
||||
CCGFace *f= ccgFaceIterator_getCurrent(fi);
|
||||
EditFace *efa= ccgSubSurf_getFaceFaceHandle(ss, f);
|
||||
@ -780,7 +778,6 @@ static void ccgDM_drawFacesSolid(DerivedMesh *dm, void (*setMaterial)(int)) {
|
||||
float (*faceGridData)[3] = ccgSubSurf_getFaceGridDataArray(ss, f, S);
|
||||
|
||||
for (y=0; y<gridSize-1; y++) {
|
||||
float *c = NULL;
|
||||
|
||||
glBegin(GL_QUADS);
|
||||
for (x=0; x<gridSize-1; x++) {
|
||||
@ -790,15 +787,20 @@ static void ccgDM_drawFacesSolid(DerivedMesh *dm, void (*setMaterial)(int)) {
|
||||
float *d = faceGridData[(y+1)*gridSize + x];
|
||||
|
||||
if (x<gridSize-1) {
|
||||
float a_cX = c[0]-a[0], a_cY = c[1]-a[1], a_cZ = c[2]-a[2];
|
||||
float b_dX = d[0]-b[0], b_dY = d[1]-b[1], b_dZ = d[2]-b[2];
|
||||
float no[3];
|
||||
CalcNormFloat4(a, b, c, d, no);
|
||||
|
||||
no[0] = b_dY*a_cZ - b_dZ*a_cY;
|
||||
no[1] = b_dZ*a_cX - b_dX*a_cZ;
|
||||
no[2] = b_dX*a_cY - b_dY*a_cX;
|
||||
glNormal3fv(no);
|
||||
}
|
||||
|
||||
glVertex3fv(a);
|
||||
glVertex3fv(b);
|
||||
glVertex3fv(c);
|
||||
glVertex3fv(d);
|
||||
glVertex3fv(c);
|
||||
glVertex3fv(b);
|
||||
glVertex3fv(a);
|
||||
}
|
||||
glEnd();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user