- removed mface->puno flags, was only used to flip normals in display
authorDaniel Dunbar <daniel@zuster.org>
Sat, 23 Jul 2005 16:09:08 +0000 (16:09 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Sat, 23 Jul 2005 16:09:08 +0000 (16:09 +0000)
   and this is better left to user (whee this was a fun commit! so
   much deleting!)
 - removed mesh_calculate_vertex_normals (replaced by mesh_calc_normals)

12 files changed:
source/blender/blenkernel/BKE_mesh.h
source/blender/blenkernel/intern/DerivedMesh.c
source/blender/blenkernel/intern/displist.c
source/blender/blenkernel/intern/mesh.c
source/blender/blenlib/BLI_editVert.h
source/blender/makesdna/DNA_meshdata_types.h
source/blender/python/api2_2x/NMesh.c
source/blender/src/booleanops.c
source/blender/src/buttons_editing.c
source/blender/src/editmesh.c
source/blender/src/editmesh_lib.c
source/blender/src/meshtools.c

index f92ad61191c2c1c407aaa40edc62ec92a0d0e2b0..7c28297194e77165a2efa1a3e95699e591ff15fe 100644 (file)
@@ -82,12 +82,6 @@ void mesh_get_texspace(struct Mesh *me, float *loc_r, float *rot_r, float *size_
 
 void make_edges(struct Mesh *me);
 
-       /** Generate the mesh vertex normals by averaging over connected faces.
-        *
-        * @param me The mesh to update.
-        */
-void mesh_calculate_vertex_normals     (struct Mesh *me);
-
        /* Calculate vertex and face normals, face normals are returned in *faceNors_r if non-NULL
         * and vertex normals are stored in actual mverts.
         */
index 598a8ae9ac439bce14d8447b2e4ccf3c5072bba3..89b6f1458a47c4f237e048b9d5d98592b31522fa 100644 (file)
@@ -239,14 +239,10 @@ static void meshDM_drawFacesSolid(DerivedMesh *dm, int (*setMaterial)(int))
        int a;
        int glmode=-1, shademodel=-1, matnr=-1, drawCurrentMat=1;
 
-#define PASSVERT(index, punoBit) {                             \
+#define PASSVERT(index) {                                              \
        if (shademodel==GL_SMOOTH) {                            \
                short *no = mvert[index].no;                    \
-               if (mface->puno&punoBit) {                              \
-                       glNormal3s(-no[0], -no[1], -no[2]); \
-               } else {                                                                \
-                       glNormal3sv(no);                                        \
-               }                                                                               \
+               glNormal3sv(no);                                                \
        }                                                                                       \
        glVertex3fv(mvert[index].co);   \
 }
@@ -273,11 +269,11 @@ static void meshDM_drawFacesSolid(DerivedMesh *dm, int (*setMaterial)(int))
                                if(shademodel==GL_FLAT) 
                                        glNormal3fv(nors);
 
-                               PASSVERT(mface->v1, ME_FLIPV1);
-                               PASSVERT(mface->v2, ME_FLIPV2);
-                               PASSVERT(mface->v3, ME_FLIPV3);
+                               PASSVERT(mface->v1);
+                               PASSVERT(mface->v2);
+                               PASSVERT(mface->v3);
                                if (mface->v4) {
-                                       PASSVERT(mface->v4, ME_FLIPV4);
+                                       PASSVERT(mface->v4);
                                }
                        }
                }
index ada30151d1e71dcf9735f73e7f1ee275aea17f73..19783978383db7a659c81ea1661ff818f03fda1f 100644 (file)
@@ -168,7 +168,6 @@ void displistmesh_to_mesh(DispListMesh *dlm, Mesh *me)
                        mf->v4= oldmf->v4;
                        mf->flag= oldmf->flag;
                        mf->mat_nr= oldmf->mat_nr;
-                       mf->puno= 0;
                        mf->edcode= ME_V1V2|ME_V2V3|ME_V3V4|ME_V4V1;
                }
        }
index 09922413bfb36b45649c84a21870f5b0feca9724..0dbb9f0d64ea3cd0cee2ec85951a867e455922ec 100644 (file)
@@ -543,12 +543,6 @@ void test_index_mface(MFace *mface, int nr)
                        if(a & ME_V1V2) mface->edcode |= ME_V3V1;
                        if(a & ME_V2V3) mface->edcode |= ME_V1V2;
                        if(a & ME_V3V1) mface->edcode |= ME_V2V3;
-                       
-                       a= mface->puno;
-                       mface->puno &= ~15;
-                       if(a & ME_FLIPV1) mface->puno |= ME_FLIPV2;
-                       if(a & ME_FLIPV2) mface->puno |= ME_FLIPV3;
-                       if(a & ME_FLIPV3) mface->puno |= ME_FLIPV1;
                }
        }
        else if(nr==4) {
@@ -561,13 +555,6 @@ void test_index_mface(MFace *mface, int nr)
                        if(a & ME_V2V3) mface->edcode |= ME_V2V3;
                        if(a & ME_V3V4) mface->edcode |= ME_V1V2;
                        if(a & ME_V4V1) mface->edcode |= ME_V4V1;
-
-                       a= mface->puno;
-                       mface->puno &= ~15;
-                       if(a & ME_FLIPV1) mface->puno |= ME_FLIPV3;
-                       if(a & ME_FLIPV2) mface->puno |= ME_FLIPV4;
-                       if(a & ME_FLIPV3) mface->puno |= ME_FLIPV1;
-                       if(a & ME_FLIPV4) mface->puno |= ME_FLIPV2;
                }
        }
 }
@@ -631,12 +618,6 @@ void test_index_face(MFace *mface, TFace *tface, int nr)
                        if(a & ME_V1V2) mface->edcode |= ME_V3V1;
                        if(a & ME_V2V3) mface->edcode |= ME_V1V2;
                        if(a & ME_V3V1) mface->edcode |= ME_V2V3;
-                       
-                       a= mface->puno;
-                       mface->puno &= ~15;
-                       if(a & ME_FLIPV1) mface->puno |= ME_FLIPV2;
-                       if(a & ME_FLIPV2) mface->puno |= ME_FLIPV3;
-                       if(a & ME_FLIPV3) mface->puno |= ME_FLIPV1;
                }
        }
        else if(nr==4) {
@@ -664,13 +645,6 @@ void test_index_face(MFace *mface, TFace *tface, int nr)
                        if(a & ME_V2V3) mface->edcode |= ME_V2V3;
                        if(a & ME_V3V4) mface->edcode |= ME_V1V2;
                        if(a & ME_V4V1) mface->edcode |= ME_V4V1;
-
-                       a= mface->puno;
-                       mface->puno &= ~15;
-                       if(a & ME_FLIPV1) mface->puno |= ME_FLIPV3;
-                       if(a & ME_FLIPV2) mface->puno |= ME_FLIPV4;
-                       if(a & ME_FLIPV3) mface->puno |= ME_FLIPV1;
-                       if(a & ME_FLIPV4) mface->puno |= ME_FLIPV2;
                }
        }
 }
@@ -679,7 +653,7 @@ void flipnorm_mesh(Mesh *me)
 {
        MFace *mface;
        MVert *mvert;
-       int a, temp;
+       int a;
        
        mvert= me->mvert;
        a= me->totvert;
@@ -698,21 +672,10 @@ void flipnorm_mesh(Mesh *me)
                                SWAP(int, mface->v4, mface->v1);
                                SWAP(int, mface->v3, mface->v2);
                                test_index_mface(mface, 4);
-                               temp= mface->puno;
-                               mface->puno &= ~15;
-                               if(temp & ME_FLIPV1) mface->puno |= ME_FLIPV4;
-                               if(temp & ME_FLIPV2) mface->puno |= ME_FLIPV3;
-                               if(temp & ME_FLIPV3) mface->puno |= ME_FLIPV2;
-                               if(temp & ME_FLIPV4) mface->puno |= ME_FLIPV1;
                        }
                        else {
                                SWAP(int, mface->v3, mface->v1);
                                test_index_mface(mface, 3);
-                               temp= mface->puno;
-                               mface->puno &= ~15;
-                               if(temp & ME_FLIPV1) mface->puno |= ME_FLIPV3;
-                               if(temp & ME_FLIPV2) mface->puno |= ME_FLIPV2;
-                               if(temp & ME_FLIPV3) mface->puno |= ME_FLIPV1;
                        }
                }
                mface++;
@@ -894,7 +857,6 @@ void mball_to_mesh(ListBase *lb, Mesh *me)
                        mface->v3= index[2];
                        mface->v4= index[3];
 
-                       mface->puno= 0;
                        mface->edcode= ME_V1V2+ME_V2V3;
                        mface->flag = ME_SMOOTH;
                        
@@ -1041,7 +1003,6 @@ void nurbs_to_mesh(Object *ob)
                                mface->v3= startvert+index[2];
                                mface->v4= 0;
        
-                               mface->puno= 7;
                                mface->edcode= ME_V1V2+ME_V2V3;
                                test_index_mface(mface, 3);
                                
@@ -1177,43 +1138,6 @@ void mcol_to_tface(Mesh *me, int freedata)
        }
 }
 
-void mesh_calculate_vertex_normals(Mesh *me)
-{
-       float (*tempNorms)[3]= MEM_callocN(me->totvert*sizeof(*tempNorms), "tempNorms");
-       int i;
-
-       for (i=0; i<me->totface; i++) {
-               MFace *mf= &((MFace*) me->mface)[i];
-               float f_no[3];
-
-               if (!mf->v3)
-                       continue;
-                       
-               if (mf->v4) {
-                       CalcNormFloat4(me->mvert[mf->v1].co, me->mvert[mf->v2].co, me->mvert[mf->v3].co, me->mvert[mf->v4].co, f_no);
-               } else {
-                       CalcNormFloat(me->mvert[mf->v1].co, me->mvert[mf->v2].co, me->mvert[mf->v3].co, f_no);
-               }
-               
-               VecAddf(tempNorms[mf->v1], tempNorms[mf->v1], f_no);
-               VecAddf(tempNorms[mf->v2], tempNorms[mf->v2], f_no);
-               VecAddf(tempNorms[mf->v3], tempNorms[mf->v3], f_no);
-               if (mf->v4)
-                       VecAddf(tempNorms[mf->v4], tempNorms[mf->v4], f_no);
-       }
-       for (i=0; i<me->totvert; i++) {
-               MVert *mv= &me->mvert[i];
-               float *no= tempNorms[i];
-               
-               Normalise(no);
-               mv->no[0]= (short)(no[0]*32767.0);
-               mv->no[1]= (short)(no[1]*32767.0);
-               mv->no[2]= (short)(no[2]*32767.0);
-       }
-       
-       MEM_freeN(tempNorms);
-}
-
 void mesh_delete_material_index(Mesh *me, int index) {
        int i;
 
index a5fcf32d76e7794d062d878481ad56caa8314a6c..6263a35432d39a2105a9a6369d77b7fff169fbb8 100644 (file)
@@ -85,7 +85,7 @@ typedef struct EditFace
        short xs, ys;           /* selection */
        struct TFace tf;        /* a copy of original tface. */
        unsigned char mat_nr, flag;
-       unsigned char f, f1, h, puno;
+       unsigned char f, f1, h;
        unsigned char fast;                     /* only 0 or 1, for editmesh_fastmalloc */
        unsigned char fgonf;            /* flag for fgon options */
 } EditFace;
index 0a186765caee93e394deb9594085802966ff911d..3d2941e4d4cd0c3d9c062e5d67cded746402f341 100644 (file)
@@ -36,7 +36,7 @@ struct Bone;
 
 typedef struct MFace {
        unsigned int v1, v2, v3, v4;
-       char puno, mat_nr;
+       char pad, mat_nr;
        char edcode, flag;
 } MFace;
 
index 0c9839460e637580f8b11487ed5ce5fe3306d7ef..d5e04b00f32bfc487c772b04cb3659d84084c3a3 100644 (file)
@@ -2337,7 +2337,6 @@ static void mface_from_data( MFace * mf, TFace * tf, MCol * col,
                test_index_mface( mf, i );
        }
 
-       mf->puno = 0;
        mf->mat_nr = from->mat_nr;
        mf->edcode = 0;
        mf->flag = from->mf_flag;
index bd706dd592b9266e0d3428e80896fa1c0f920a83..09b0629de1a365af340e9d6c6dccb40eb8f198ea 100644 (file)
@@ -727,7 +727,6 @@ ConvertCSGDescriptorsToMeshObject(
                mface->v4 = 0;
 
                mface->edcode = ME_V1V2|ME_V2V3|ME_V3V4|ME_V4V1;
-               mface->puno = 0;
                mface->mat_nr = 0;
                mface->flag = fdata->faceflag;
                
@@ -781,7 +780,7 @@ ConvertCSGDescriptorsToMeshObject(
 
        me->totface = face_it->num_elements;
 
-       mesh_calculate_vertex_normals(me);
+       mesh_calc_normals(me->mvert, me->totvert, me->mface, me->totface, NULL);
                
        // thats it!
        if (user_face_vertex_data) {
index b6beb3e54e612f3b9a3ab5c8d0be48e74b4208f3..5198b37740ba39608406670dad952af469da6d86 100644 (file)
@@ -2224,19 +2224,20 @@ static void editing_panel_mesh_tools1(Object *ob, Mesh *me)
 
        uiBlockBeginAlign(block);
        uiDefButF(block, NUM,             REDRAWVIEW3D, "NSize:",       955, 131, 150, 19, &G.scene->editbutsize, 0.001, 2.0, 10, 0, "Sets the length to use when displaying face normals");
-       uiDefButI(block, TOG|BIT|6, REDRAWVIEW3D, "Draw Normals",       955,110,150,19, &G.f, 0, 0, 0, 0, "Displays face normals as lines");
-       uiDefButI(block, TOG|BIT|7, REDRAWVIEW3D, "Draw Faces",         955,88,150,19, &G.f, 0, 0, 0, 0, "Displays all faces as shades");
-       uiDefButI(block, TOG|BIT|18, REDRAWVIEW3D, "Draw Edges",        955,66,150,19, &G.f, 0, 0, 0, 0, "Displays selected edges using hilights");
-       uiDefButI(block, TOG|BIT|19, REDRAWVIEW3D, "Draw Creases",      955,44,150,19, &G.f, 0, 0, 0, 0, "Displays creases created for subsurf weighting");
-       uiDefButI(block, TOG|BIT|20, REDRAWVIEW3D, "Draw Seams",        955,22,150,19, &G.f, 0, 0, 0, 0, "Displays UV unwrapping seams");
-       uiDefButI(block, TOG|BIT|11, 0, "All Edges",                    955, 0,150,19, &G.f, 0, 0, 0, 0, "Displays all edges in object mode without optimization");
+       uiDefButBitI(block, TOG, G_DRAWNORMALS, REDRAWVIEW3D, "Draw Normals",   955,110,150,19, &G.f, 0, 0, 0, 0, "Displays face normals as lines");
+       uiDefButBitI(block, TOG, G_DRAWFACES, REDRAWVIEW3D, "Draw Faces",               955,88,150,19, &G.f, 0, 0, 0, 0, "Displays all faces as shades");
+       uiDefButBitI(block, TOG, G_DRAWEDGES, REDRAWVIEW3D, "Draw Edges",       955,66,150,19, &G.f, 0, 0, 0, 0, "Displays selected edges using hilights");
+       uiDefButBitI(block, TOG, G_DRAWCREASES, REDRAWVIEW3D, "Draw Creases",   955,44,150,19, &G.f, 0, 0, 0, 0, "Displays creases created for subsurf weighting");
+       uiDefButBitI(block, TOG, G_DRAWSEAMS, REDRAWVIEW3D, "Draw Seams",       955,22,150,19, &G.f, 0, 0, 0, 0, "Displays UV unwrapping seams");
+       uiDefButBitI(block, TOG, G_ALLEDGES, 0, "All Edges",                    955, 0,150,19, &G.f, 0, 0, 0, 0, "Displays all edges in object mode without optimization");
        uiBlockEndAlign(block);
        
        /* Measurement drawing options */
        uiBlockBeginAlign(block);
-       uiDefButI(block, TOG|BIT|22, REDRAWVIEW3D, "Edge Length",       1125,131,150,19, &G.f, 0, 0, 0, 0, "Displays selected edge lengths");
-       uiDefButI(block, TOG|BIT|24, REDRAWVIEW3D, "Edge Angles",       1125,110,150,19,  &G.f, 0, 0, 0, 0, "Displays the angles in the selected edges in degrees");
-       uiDefButI(block, TOG|BIT|23, REDRAWVIEW3D, "Face Area",         1125,88,150,19, &G.f, 0, 0, 0, 0, "Displays the area of selected faces");
+       uiDefButBitI(block, TOG, G_DRAW_VNORMALS, REDRAWVIEW3D, "Draw VNormals",1125,110,150,19, &G.f, 0, 0, 0, 0, "Displays vertex normals as lines");
+       uiDefButBitI(block, TOG, G_DRAW_EDGELEN, REDRAWVIEW3D, "Edge Length",   1125,88,150,19, &G.f, 0, 0, 0, 0, "Displays selected edge lengths");
+       uiDefButBitI(block, TOG, G_DRAW_EDGEANG, REDRAWVIEW3D, "Edge Angles",   1125,66,150,19,  &G.f, 0, 0, 0, 0, "Displays the angles in the selected edges in degrees");
+       uiDefButBitI(block, TOG, G_DRAW_FACEAREA, REDRAWVIEW3D, "Face Area",    1125,44,150,19, &G.f, 0, 0, 0, 0, "Displays the area of selected faces");
        uiBlockEndAlign(block);
 
 }
index bcfc70c4e62aa211891d4a48817944578db2157e..12b931d74314e068bf1e690147a6f689a824e478 100644 (file)
@@ -857,13 +857,6 @@ static void fix_faceindices(MFace *mface, EditFace *efa, int nr)
                        if(a & ME_V1V2) mface->edcode |= ME_V3V1;
                        if(a & ME_V2V3) mface->edcode |= ME_V1V2;
                        if(a & ME_V3V1) mface->edcode |= ME_V2V3;
-                       
-                       a= mface->puno;
-                       mface->puno &= ~15;
-                       if(a & ME_FLIPV1) mface->puno |= ME_FLIPV2;
-                       if(a & ME_FLIPV2) mface->puno |= ME_FLIPV3;
-                       if(a & ME_FLIPV3) mface->puno |= ME_FLIPV1;
-
                }
        }
        else if(nr==4) {
@@ -891,14 +884,6 @@ static void fix_faceindices(MFace *mface, EditFace *efa, int nr)
                        if(a & ME_V2V3) mface->edcode |= ME_V2V3;
                        if(a & ME_V3V4) mface->edcode |= ME_V1V2;
                        if(a & ME_V4V1) mface->edcode |= ME_V4V1;
-
-                       a= mface->puno;
-                       mface->puno &= ~15;
-                       if(a & ME_FLIPV1) mface->puno |= ME_FLIPV3;
-                       if(a & ME_FLIPV2) mface->puno |= ME_FLIPV4;
-                       if(a & ME_FLIPV3) mface->puno |= ME_FLIPV1;
-                       if(a & ME_FLIPV4) mface->puno |= ME_FLIPV2;
-
                }
        }
 }
@@ -1051,7 +1036,6 @@ void load_editMesh(void)
                if(efa->v4) mface->v4= (unsigned int) efa->v4->vn;
                        
                mface->mat_nr= efa->mat_nr;
-               mface->puno= efa->puno;
                
                mface->flag= efa->flag;
                /* bit 0 of flag is already taken for smooth... */
@@ -1613,7 +1597,7 @@ typedef struct EditEdgeC
 typedef struct EditFaceC
 {
        int v1, v2, v3, v4;
-       unsigned char mat_nr, flag, f, h, puno, fgonf;
+       unsigned char mat_nr, flag, f, h, fgonf;
        short pad1;
 } EditFaceC;
 
@@ -1713,7 +1697,6 @@ static void *editMesh_to_undoMesh(void)
                efac->flag= efa->flag;
                efac->f= efa->f;
                efac->h= efa->h;
-               efac->puno= efa->puno;
                efac->fgonf= efa->fgonf;
                
                if(tface) {
@@ -1782,7 +1765,6 @@ static void undoMesh_to_editMesh(void *umv)
                efa->flag= efac->flag;
                efa->f= efac->f;
                efa->h= efac->h;
-               efa->puno= efac->puno;
                efa->fgonf= efac->fgonf;
                
                if(tface) {
index e0b8afd47318188362fc895ba2933361daefe853..58879a39fbd31aab101fac29e3b87fe743e1c687 100644 (file)
@@ -1312,8 +1312,8 @@ void vertexnormals(int testflip)
        Mesh *me;
        EditVert *eve;
        EditFace *efa;  
-       float n1[3], n2[3], n3[3], n4[3], co[4], fac1, fac2, fac3, fac4, *temp;
-       float *f1, *f2, *f3, *f4, xn, yn, zn;
+       float n1[3], n2[3], n3[3], n4[3], co[4], *temp;
+       float xn, yn, zn;
        float len, area;
        
        if(G.obedit && G.obedit->type==OB_MESH) {
@@ -1440,42 +1440,11 @@ void vertexnormals(int testflip)
        /* vertex normal flip-flags for shade (render) */
        efa= em->faces.first;
        while(efa) {
-               efa->puno=0;                    
-
-               if(testflip) {
-                       f1= efa->v1->no;
-                       f2= efa->v2->no;
-                       f3= efa->v3->no;
-                       
-                       fac1= efa->n[0]*f1[0] + efa->n[1]*f1[1] + efa->n[2]*f1[2];
-                       if(fac1<0.0) {
-                               efa->puno = ME_FLIPV1;
-                       }
-                       fac2= efa->n[0]*f2[0] + efa->n[1]*f2[1] + efa->n[2]*f2[2];
-                       if(fac2<0.0) {
-                               efa->puno += ME_FLIPV2;
-                       }
-                       fac3= efa->n[0]*f3[0] + efa->n[1]*f3[1] + efa->n[2]*f3[2];
-                       if(fac3<0.0) {
-                               efa->puno += ME_FLIPV3;
-                       }
-                       if(efa->v4) {
-                               f4= efa->v4->no;
-                               fac4= efa->n[0]*f4[0] + efa->n[1]*f4[1] + efa->n[2]*f4[2];
-                               if(fac4<0.0) {
-                                       efa->puno += ME_FLIPV4;
-                               }
-                       }
-               }
                /* projection for cubemap! */
                xn= fabs(efa->n[0]);
                yn= fabs(efa->n[1]);
                zn= fabs(efa->n[2]);
                
-               if(zn>xn && zn>yn) efa->puno += ME_PROJXY;
-               else if(yn>xn && yn>zn) efa->puno += ME_PROJXZ;
-               else efa->puno += ME_PROJYZ;
-               
                efa= efa->next;
        }
 }
index 614baa80c1b3f19ac063dfae18e841446416c5fa..a2622982faefe24bf40379b44e33d7c999c5d949 100644 (file)
@@ -561,8 +561,8 @@ void vertexnormals_mesh(Mesh *me)
 {
        MVert *mvert;
        MFace *mface;
-       float n1[3], n2[3], n3[3], n4[3], co[4], fac1, fac2, fac3, fac4, *temp;
-       float *f1, *f2, *f3, *f4, xn, yn, zn, *normals;
+       float n1[3], n2[3], n3[3], n4[3], co[4], *temp;
+       float xn, yn, zn, *normals;
        float *v1, *v2, *v3, *v4, len, vnor[3];
        int a, testflip;
 
@@ -671,8 +671,6 @@ void vertexnormals_mesh(Mesh *me)
        mface= me->mface;
        mvert= me->mvert;
        for(a=0; a<me->totface; a++, mface++) {
-               mface->puno=0;                  
-               
                if(mface->v3==0) continue;
                
                v1= (mvert+mface->v1)->co;
@@ -681,40 +679,10 @@ void vertexnormals_mesh(Mesh *me)
 
                CalcNormFloat(v1, v2, v3, vnor);
 
-               if(testflip) {
-                       f1= normals + 3*mface->v1;
-                       f2= normals + 3*mface->v2;
-                       f3= normals + 3*mface->v3;
-
-                       fac1= vnor[0]*f1[0] + vnor[1]*f1[1] + vnor[2]*f1[2];
-                       if(fac1<0.0) {
-                               mface->puno = ME_FLIPV1;
-                       }
-                       fac2= vnor[0]*f2[0] + vnor[1]*f2[1] + vnor[2]*f2[2];
-                       if(fac2<0.0) {
-                               mface->puno += ME_FLIPV2;
-                       }
-                       fac3= vnor[0]*f3[0] + vnor[1]*f3[1] + vnor[2]*f3[2];
-                       if(fac3<0.0) {
-                               mface->puno += ME_FLIPV3;
-                       }
-                       if(mface->v4) {
-                               f4= normals + 3*mface->v4;
-                               fac4= vnor[0]*f4[0] + vnor[1]*f4[1] + vnor[2]*f4[2];
-                               if(fac4<0.0) {
-                                       mface->puno += ME_FLIPV4;
-                               }
-                       }
-               }
                /* proj for cubemap! */
                xn= fabs(vnor[0]);
                yn= fabs(vnor[1]);
                zn= fabs(vnor[2]);
-               
-               if(zn>xn && zn>yn) mface->puno += ME_PROJXY;
-               else if(yn>xn && yn>zn) mface->puno += ME_PROJXZ;
-               else mface->puno += ME_PROJYZ;
-               
        }
        
        MEM_freeN(normals);