Evil commit! Nothing really changed except;
authorTon Roosendaal <ton@blender.org>
Sat, 18 Sep 2004 20:15:37 +0000 (20:15 +0000)
committerTon Roosendaal <ton@blender.org>
Sat, 18 Sep 2004 20:15:37 +0000 (20:15 +0000)
- EditVlak -> EditFace
- variables called 'evl' -> 'efa'
- functions with 'vlak' in it now have 'face'

Just thought was nice starter for editmesh recode...

15 files changed:
source/blender/blenkernel/intern/displist.c
source/blender/blenkernel/intern/exotic.c
source/blender/blenkernel/intern/subsurf.c
source/blender/blenlib/BLI_blenlib.h
source/blender/blenlib/BLI_editVert.h
source/blender/blenlib/intern/scanfill.c
source/blender/include/BIF_editmesh.h
source/blender/include/BSE_trans_types.h
source/blender/include/BSE_types.h
source/blender/src/buttons_editing.c
source/blender/src/drawobject.c
source/blender/src/edit.c
source/blender/src/editmesh.c
source/blender/src/header_view3d.c
source/blender/src/space.c

index 932eccb23573cccf3cb4cf96a20871de129aa85a..dfae3c6b12bc7b2848870aa669401d2ae6b03593 100644 (file)
@@ -113,7 +113,7 @@ DispListMesh *displistmesh_from_editmesh(EditMesh *em)
        DispListMesh *dlm= MEM_callocN(sizeof(*dlm),"dlm");
        EditVert *eve, *evePrev;
        EditEdge *eed;
-       EditVlak *evl;
+       EditFace *evl;
        MFace *mfNew;
        int i;
 
@@ -1457,7 +1457,7 @@ static void curve_to_displist(ListBase *nubase, ListBase *dispbase)
 static void filldisplist(ListBase *dispbase, ListBase *to)
 {
        EditVert *eve, *v1, *vlast;
-       EditVlak *evl;
+       EditFace *evl;
        DispList *dlnew=0, *dl;
        float *f1;
        int colnr=0, cont=1, tot, a, *index;
@@ -1519,9 +1519,9 @@ static void filldisplist(ListBase *dispbase, ListBase *to)
 
                if(totvert && BLI_edgefill(0)!=0) {
 
-                       /* count faces (vlak in dutch!) */
+                       /* count faces  */
                        tot= 0;
-                       evl= fillvlakbase.first;
+                       evl= fillfacebase.first;
                        while(evl) {
                                tot++;
                                evl= evl->next;
@@ -1553,7 +1553,7 @@ static void filldisplist(ListBase *dispbase, ListBase *to)
                                }
                                
                                /* index data */
-                               evl= fillvlakbase.first;
+                               evl= fillfacebase.first;
                                index= dlnew->index;
                                while(evl) {
                                        index[0]= (long)evl->v1->vn;
index 7c93de76c2ac3c9573059c86b542476622033415..5348aea6e2a4cdb93d47a1b64b6a5e1183f83037 100644 (file)
@@ -1942,7 +1942,7 @@ static void displist_to_mesh(DispList *dlfirst)
        MVert *mvert;
        MFace *mface;
        float *data, vec[3], min[3], max[3];
-       int a, b, startve, *idata, totedge=0, tottria=0, totquad=0, totvert=0, totvlak, totcol=0, colnr;
+       int a, b, startve, *idata, totedge=0, tottria=0, totquad=0, totvert=0, totface, totcol=0, colnr;
        int p1, p2, p3, p4;
                
        /* count first */
@@ -2096,14 +2096,14 @@ static void displist_to_mesh(DispList *dlfirst)
                }
        }
        
-       totvlak= totquad+tottria+totedge;
+       totface= totquad+tottria+totedge;
 
-       printf("Import: %d vertices %d faces\n", totvert, totvlak);
+       printf("Import: %d vertices %d faces\n", totvert, totface);
        
        if(totvert) me->mvert= MEM_callocN(totvert*sizeof(MVert), "mvert");
-       if(totvlak) me->mface= MEM_callocN(totvlak*sizeof(MFace), "mface");
+       if(totface) me->mface= MEM_callocN(totface*sizeof(MFace), "mface");
        me->totvert= totvert;
-       me->totface= totvlak;
+       me->totface= totface;
        
        mvert= me->mvert;
        mface= me->mface;
@@ -2682,7 +2682,7 @@ static void write_videoscape_mesh(Object *ob, char *str)
        MFace *mface;
        FILE *fp;
        EditVert *eve;
-       EditVlak *evl;
+       EditFace *evl;
        unsigned int kleur[32];
        float co[3];
        int a;
index 4a8724272b7bb47b515b4c40f7352251869e91f3..93ef1fa870c184dcdeb039c7852934dded7922fc 100644 (file)
@@ -206,7 +206,7 @@ struct _HyperFace {
                /* for getting back tface, matnr, etc */
        union {
                int ind;
-               EditVlak *ef;
+               EditFace *ef;
        } orig;
 };
 
@@ -423,7 +423,7 @@ static HyperMesh *hypermesh_from_editmesh(EditMesh *em, int subdivLevels) {
        HyperMesh *hme= hypermesh_new();
        EditVert *ev, *prevev;
        EditEdge *ee;
-       EditVlak *ef;
+       EditFace *ef;
        float creasefac= (float)subdivLevels;
        int flag;
 
@@ -1021,7 +1021,7 @@ static DispListMesh *hypermesh_to_displistmesh(HyperMesh *hme, short flag) {
                        mf->flag= origmf->flag;
                        mf->puno= 0;
                } else {
-                       EditVlak *origef= f->orig.ef;
+                       EditFace *origef= f->orig.ef;
                        
                        mf->mat_nr= origef->mat_nr;
                        mf->flag= origef->flag;
index fc4c85ad681c4896e3ef952e0ef913c9f0584f1a..49d885e5b301cef3f453860dc1ed030af2056881 100644 (file)
 #ifndef BLI_BLENLIB_H
 #define BLI_BLENLIB_H
 
-#include "DNA_listBase.h" /* braindamage for the masses... needed
-                             because fillvlakbase and fillvertbase are
-                             used outside */
+/* braindamage for the masses... needed
+       because fillfacebase and fillvertbase are used outside */
+#include "DNA_listBase.h" 
 
-extern ListBase fillvlakbase;
+extern ListBase fillfacebase;
 extern ListBase fillvertbase;
 /**
  * @attention Defined in scanfill.c
index 3f477036c0b8567b2d624e951d0e89e5a3443e7c..05670ccc69caa748c112851bce88afe1376ff31e 100644 (file)
@@ -63,16 +63,16 @@ typedef struct EditEdge
        float crease;
 } EditEdge;
 
-typedef struct EditVlak
+typedef struct EditFace
 {
-       struct EditVlak *next, *prev;
+       struct EditFace *next, *prev;
        struct EditVert *v1, *v2, *v3, *v4;
        struct EditEdge *e1, *e2, *e3, *e4;
        float n[3];
        struct TFace tf;        /* a copy of original tface. */
        unsigned char mat_nr, flag;
        unsigned char f, f1;
-} EditVlak;
+} EditFace;
 
 typedef struct EditMesh
 {
index b11f1eb302fe71cf4c10cb30a5856518728c7842..bfa9c9ddf58589b9d48b16d6727d30e940c44324 100644 (file)
@@ -115,7 +115,7 @@ typedef struct ScFillVert {
 int vergscdata(const void *a1, const void *a2);
 int vergpoly(const void *a1, const void *a2);
 void *new_mem_element(int size);
-void addfillvlak(EditVert *v1, EditVert *v2, EditVert *v3);
+void addfillface(EditVert *v1, EditVert *v2, EditVert *v3);
 int boundinside(PolyFill *pf1, PolyFill *pf2);
 int boundisect(PolyFill *pf2, PolyFill *pf1);
 void mergepolysSimp(PolyFill *pf1, PolyFill *pf2)      /* pf2 added to pf1 */;
@@ -137,7 +137,7 @@ ScFillVert *scdata;
 
 ListBase fillvertbase = {0,0};
 ListBase filledgebase = {0,0};
-ListBase fillvlakbase = {0,0};
+ListBase fillfacebase = {0,0};
 
 short cox, coy;
 
@@ -227,7 +227,7 @@ void BLI_end_edgefill(void)
        
        fillvertbase.first= fillvertbase.last= 0;
        filledgebase.first= filledgebase.last= 0;
-       fillvlakbase.first= fillvlakbase.last= 0;
+       fillfacebase.first= fillfacebase.last= 0;
 }
 
 /* ****  FILL ROUTINES *************************** */
@@ -262,13 +262,13 @@ EditEdge *BLI_addfilledge(EditVert *v1, EditVert *v2)
        return newed;
 }
 
-void addfillvlak(EditVert *v1, EditVert *v2, EditVert *v3)
+void addfillface(EditVert *v1, EditVert *v2, EditVert *v3)
 {
        /* does not make edges */
-       EditVlak *evl;
+       EditFace *evl;
 
-       evl= new_mem_element(sizeof(EditVlak));
-       BLI_addtail(&fillvlakbase, evl);
+       evl= new_mem_element(sizeof(EditFace));
+       BLI_addtail(&fillfacebase, evl);
        
        evl->v1= v1;
        evl->v2= v2;
@@ -596,7 +596,7 @@ void scanfill(PolyFill *pf)
        EditVert *eve,*v1,*v2,*v3;
        EditEdge *eed,*nexted,*ed1,*ed2,*ed3;
        float miny = 0.0;
-       int a,b,verts, maxvlak, totvlak;        /* vlak = face in dutch! */
+       int a,b,verts, maxface, totface;        
        short nr, test, twoconnected=0;
 
        nr= pf->nr;
@@ -695,8 +695,8 @@ void scanfill(PolyFill *pf)
        if(pf->f==0) twoconnected= 1;
 
        /* (temporal) security: never much more faces than vertices */
-       totvlak= 0;
-       maxvlak= 2*verts;               /* 2*verts: based at a filled circle within a triangle */
+       totface= 0;
+       maxface= 2*verts;               /* 2*verts: based at a filled circle within a triangle */
 
        sc= scdata;
        for(a=0;a<verts;a++) {
@@ -719,7 +719,7 @@ void scanfill(PolyFill *pf)
                        ed2= ed1->next;
 
                        if(callLocalInterruptCallBack()) break;
-                       if(totvlak>maxvlak) {
+                       if(totface>maxface) {
                                /* printf("Fill error: endless loop. Escaped at vert %d,  tot: %d.\n", a, verts); */
                                a= verts;
                                break;
@@ -774,8 +774,8 @@ void scanfill(PolyFill *pf)
                                else {
                                        /* new triangle */
                                        /* printf("add face %x %x %x\n",v1,v2,v3); */
-                                       addfillvlak(v1, v2, v3);
-                                       totvlak++;
+                                       addfillface(v1, v2, v3);
+                                       totface++;
                                        BLI_remlink((ListBase *)&(sc->first),ed1);
                                        BLI_addtail(&filledgebase,ed1);
                                        ed1->v2->f= 0;
@@ -1128,107 +1128,9 @@ int BLI_edgefill(int mode)  /* THE MAIN FILL ROUTINE */
        addlisttolist(&fillvertbase,&tempve);
        addlisttolist(&filledgebase,&temped);
 
-       /* evl= fillvlakbase.first;     
-       while(evl) {
-               printf("new face %x %x %x\n",evl->v1,evl->v2,evl->v3);
-               evl= evl->next;
-       }*/
-
-
        /* FREE */
 
        MEM_freeN(pflist);
        return 1;
 
 }
-
-/*
-  MOVED TO EDITMESH.C since it's really bad to leave it here
-  
-void fill_mesh(void)
-{
-       EditMesh *em = G.editMesh;
-       EditVert *eve,*v1;
-       EditEdge *eed,*e1,*nexted;
-       EditVlak *evl,*nextvl;
-       short ok;
-
-       if(G.obedit==0 || (G.obedit->type!=OB_MESH)) return;
-
-       waitcursor(1);
-
-       / * alle selected vertices kopieeren * /
-       eve= em->verts.first;
-       while(eve) {
-               if(eve->f & 1) {
-                       v1= addfillvert(eve->co);
-                       eve->vn= v1;
-                       v1->vn= eve;
-                       v1->h= 0;
-               }
-               eve= eve->next;
-       }
-       / * alle selected edges kopieeren * /
-       eed= em->edges.first;
-       while(eed) {
-               if( (eed->v1->f & 1) && (eed->v2->f & 1) ) {
-                       e1= addfilledge(eed->v1->vn, eed->v2->vn);
-                       e1->v1->h++; 
-                       e1->v2->h++;
-               }
-               eed= eed->next;
-       }
-       / * van alle selected vlakken vertices en edges verwijderen om dubbels te voorkomen * /
-       / * alle edges tellen punten op, vlakken trekken af,
-          edges met vertices ->h<2 verwijderen * /
-       evl= em->faces.first;
-       ok= 0;
-       while(evl) {
-               nextvl= evl->next;
-               if( vlakselectedAND(evl, 1) ) {
-                       evl->v1->vn->h--;
-                       evl->v2->vn->h--;
-                       evl->v3->vn->h--;
-                       if(evl->v4) evl->v4->vn->h--;
-                       ok= 1;
-                       
-               }
-               evl= nextvl;
-       }
-       if(ok) {        / * er zijn vlakken geselecteerd * /
-               eed= filledgebase.first;
-               while(eed) {
-                       nexted= eed->next;
-                       if(eed->v1->h<2 || eed->v2->h<2) {
-                               remlink(&filledgebase,eed);
-                       }
-                       eed= nexted;
-               }
-       }
-
-       / * tijd=clock(); * /
-
-       ok= edgefill(0);
-
-       / * printf("time: %d\n",(clock()-tijd)/1000); * /
-
-       if(ok) {
-               evl= fillvlakbase.first;
-               while(evl) {
-                       addvlaklist(evl->v1->vn, evl->v2->vn, evl->v3->vn, 0, evl);
-                       evl= evl->next;
-               }
-       }
-       / * else printf("fill error\n"); * /
-
-       end_edgefill();
-
-       waitcursor(0);
-
-       countall();
-       allqueue(REDRAWVIEW3D, 0);
-}
-
-MOVED TO editmesh.c !!!!! (you bastards!)
-
- */
index bb4d22a66575d61a6e6a7ae814559229d729238c..176cef6c99c83bf256b7c31f144e56cde2422903 100644 (file)
@@ -33,7 +33,7 @@
 #ifndef BIF_EDITMESH_H
 #define BIF_EDITMESH_H
 
-struct EditVlak;
+struct EditFace;
 struct EditEdge;
 struct EditVert;
 struct Mesh;
@@ -82,12 +82,12 @@ void editmesh_align_view_to_selected(struct View3D *v3d, int axis);
 
 struct EditVert *addvertlist(float *vec);
 struct EditEdge *addedgelist(struct EditVert *v1, struct EditVert *v2, struct EditEdge *example);
-struct EditVlak *addvlaklist(struct EditVert *v1, struct EditVert *v2, struct EditVert *v3, struct EditVert *v4, struct EditVlak *example);
+struct EditFace *addfacelist(struct EditVert *v1, struct EditVert *v2, struct EditVert *v3, struct EditVert *v4, struct EditFace *example);
 struct EditEdge *findedgelist(struct EditVert *v1, struct EditVert *v2);
 
 void remedge(struct EditEdge *eed);
 
-int vlakselectedAND(struct EditVlak *evl, int flag);
+int faceselectedAND(struct EditFace *efa, int flag);
 
 void recalc_editnormals(void);
 void flip_editnormals(void);
@@ -135,7 +135,7 @@ void spin_mesh(int steps,int degr,float *dvec, int mode);
 void screw_mesh(int steps,int turns);
 void selectswap_mesh(void);
 void addvert_mesh(void);
-void addedgevlak_mesh(void);
+void addedgeface_mesh(void);
 void delete_mesh(void);
 void add_primitiveMesh(int type);
 void hide_mesh(int swap);
index 63f3968da428700aae8daa2cd5665742d40e5c06..59933b34610f948601bc8fe114ff21c8302bf19d 100644 (file)
@@ -34,7 +34,7 @@
 #define BSE_TRANS_TYPES_H
 
 struct Object;
-/*  struct EditVlak; */
+/*  struct EditFace; */
 /*  struct EditEdge; */
 /*  struct EditVert; */
 /*  struct ListBase; */
index cc241465dfa88388186fc087d7ae96a09d12cae4..132289f02ee1454856a3bc3901dcd3b0795cc9d9 100644 (file)
@@ -56,7 +56,7 @@ struct BezTriple;
 
 struct Nurb;
 
-struct EditVlak;
+struct EditFace;
 struct EditVert;
 struct EditEdge;
 struct EditIpo;
index de3920b2b6349060f4b140409d0716dff6a6be0b..ed5e86a270b4bc3f9e6e9b1ae5c9d09169a7bb45 100644 (file)
@@ -388,7 +388,7 @@ static void decimate_apply(void)
 void do_common_editbuts(unsigned short event) // old name, is a mix of object and editing events.... 
 {
        EditMesh *em = G.editMesh;
-       EditVlak *evl;
+       EditFace *efa;
        Base *base;
        Object *ob;
        Mesh *me;
@@ -404,16 +404,16 @@ void do_common_editbuts(unsigned short event) // old name, is a mix of object an
        case B_MATWICH:
                if(G.obedit && G.obedit->actcol>0) {
                        if(G.obedit->type == OB_MESH) {
-                               evl= em->faces.first;
-                               while(evl) {
-                                       if( vlakselectedAND(evl, 1) ) {
-                                               if(index== -1) index= evl->mat_nr;
-                                               else if(index!=evl->mat_nr) {
+                               efa= em->faces.first;
+                               while(efa) {
+                                       if( faceselectedAND(efa, 1) ) {
+                                               if(index== -1) index= efa->mat_nr;
+                                               else if(index!=efa->mat_nr) {
                                                        error("Mixed colors");
                                                        return;
                                                }
                                        }
-                                       evl= evl->next;
+                                       efa= efa->next;
                                }
                        }
                        else if ELEM(G.obedit->type, OB_CURVE, OB_SURF) {
@@ -449,11 +449,11 @@ void do_common_editbuts(unsigned short event) // old name, is a mix of object an
                if(G.obedit && G.obedit->actcol>0) {
                        if(G.obedit->type == OB_MESH) {
                                undo_push_mesh("Assign material index");
-                               evl= em->faces.first;
-                               while(evl) {
-                                       if( vlakselectedAND(evl, 1) )
-                                               evl->mat_nr= G.obedit->actcol-1;
-                                       evl= evl->next;
+                               efa= em->faces.first;
+                               while(efa) {
+                                       if( faceselectedAND(efa, 1) )
+                                               efa->mat_nr= G.obedit->actcol-1;
+                                       efa= efa->next;
                                }
                                allqueue(REDRAWVIEW3D_Z, 0);
                                makeDispList(G.obedit);
@@ -561,15 +561,15 @@ void do_common_editbuts(unsigned short event) // old name, is a mix of object an
        case B_SETSOLID:
                if(G.obedit) {
                        if(G.obedit->type == OB_MESH) {
-                               evl= em->faces.first;
+                               efa= em->faces.first;
                                if (event == B_SETSMOOTH) undo_push_mesh("Set Smooth");
                                else if (event==B_SETSOLID) undo_push_mesh("Set Solid");
-                               while(evl) {
-                                       if( vlakselectedAND(evl, 1) ) {
-                                               if(event==B_SETSMOOTH) evl->flag |= ME_SMOOTH;
-                                               else evl->flag &= ~ME_SMOOTH;
+                               while(efa) {
+                                       if( faceselectedAND(efa, 1) ) {
+                                               if(event==B_SETSMOOTH) efa->flag |= ME_SMOOTH;
+                                               else efa->flag &= ~ME_SMOOTH;
                                        }
-                                       evl= evl->next;
+                                       efa= efa->next;
                                }
 
                                makeDispList(G.obedit);
index 7f2fbcacbc9d78183960fa4b735c9fe3fc0e1415..71e4de14134be82e921dc6e7980d0bfb58a27582 100644 (file)
@@ -1724,7 +1724,7 @@ static void drawmeshsolid(Object *ob, float *nors)
        MVert *mvert;
        TFace *tface;
        MFace *mface;
-       EditVlak *evl;
+       EditFace *efa;
        float *extverts=0, *v1, *v2, *v3, *v4;
        int glmode, setsmooth=0, a, start, end, matnr= -1, vertexpaint, i;
        short no[3], *n1, *n2, *n3, *n4 = NULL;
@@ -1758,36 +1758,36 @@ static void drawmeshsolid(Object *ob, float *nors)
 
        if(ob==G.obedit || (G.obedit && ob->data==G.obedit->data)) {
                
-               evl= em->faces.first;
-               while(evl) {
-                       if(evl->v1->h==0 && evl->v2->h==0 && evl->v3->h==0) {
+               efa= em->faces.first;
+               while(efa) {
+                       if(efa->v1->h==0 && efa->v2->h==0 && efa->v3->h==0) {
                                
-                               if(evl->mat_nr!=matnr) {
-                                       matnr= evl->mat_nr;
+                               if(efa->mat_nr!=matnr) {
+                                       matnr= efa->mat_nr;
                                        set_gl_material(matnr+1);
                                }
                                
-                               if(evl->v4 && evl->v4->h==0) {
+                               if(efa->v4 && efa->v4->h==0) {
                                
                                        glBegin(GL_QUADS);
-                                               glNormal3fv(evl->n);
-                                               glVertex3fv(evl->v1->co);
-                                               glVertex3fv(evl->v2->co);
-                                               glVertex3fv(evl->v3->co);
-                                               glVertex3fv(evl->v4->co);
+                                               glNormal3fv(efa->n);
+                                               glVertex3fv(efa->v1->co);
+                                               glVertex3fv(efa->v2->co);
+                                               glVertex3fv(efa->v3->co);
+                                               glVertex3fv(efa->v4->co);
                                        glEnd();
                                }
                                else {
 
                                        glBegin(GL_TRIANGLES);
-                                               glNormal3fv(evl->n);
-                                               glVertex3fv(evl->v1->co);
-                                               glVertex3fv(evl->v2->co);
-                                               glVertex3fv(evl->v3->co);
+                                               glNormal3fv(efa->n);
+                                               glVertex3fv(efa->v1->co);
+                                               glVertex3fv(efa->v2->co);
+                                               glVertex3fv(efa->v3->co);
                                        glEnd();
                                }
                        }
-                       evl= evl->next;
+                       efa= efa->next;
                }
                
                glDisable(GL_LIGHTING);
@@ -2380,7 +2380,7 @@ static void drawmeshwire(Object *ob)
        DispList *dl;
        Material *ma;
        EditEdge *eed;
-       EditVlak *evl;
+       EditFace *efa;
        float fvec[3], cent[3], *f1, *f2, *f3, *f4, *extverts=NULL;
        int a, start, end, test, ok, handles=0;
 
@@ -2400,47 +2400,47 @@ static void drawmeshwire(Object *ob)
                        glEnable(GL_BLEND);
                        glDepthMask(0);         // disable write in zbuffer, needed for nice transp
                        
-                       evl= em->faces.first;
-                       while(evl) {
-                               if(evl->v1->h==0 && evl->v2->h==0 && evl->v3->h==0 && (evl->v4==NULL || evl->v4->h==0)) {
+                       efa= em->faces.first;
+                       while(efa) {
+                               if(efa->v1->h==0 && efa->v2->h==0 && efa->v3->h==0 && (efa->v4==NULL || efa->v4->h==0)) {
                                        
                                        if(1) {
-                                               if(vlakselectedAND(evl, 1)) glColor4ub(col2[0], col2[1], col2[2], col2[3]); 
+                                               if(faceselectedAND(efa, 1)) glColor4ub(col2[0], col2[1], col2[2], col2[3]); 
                                                else glColor4ub(col1[0], col1[1], col1[2], col1[3]);
                                                
-                                               glBegin(evl->v4?GL_QUADS:GL_TRIANGLES);
-                                               glVertex3fv(evl->v1->co);
-                                               glVertex3fv(evl->v2->co);
-                                               glVertex3fv(evl->v3->co);
-                                               if(evl->v4) glVertex3fv(evl->v4->co);
+                                               glBegin(efa->v4?GL_QUADS:GL_TRIANGLES);
+                                               glVertex3fv(efa->v1->co);
+                                               glVertex3fv(efa->v2->co);
+                                               glVertex3fv(efa->v3->co);
+                                               if(efa->v4) glVertex3fv(efa->v4->co);
                                                glEnd();
                                                
                                        } else {
-                                               if(vlakselectedAND(evl, 1)) glColor4ub(col2[0], col2[1], col2[2], col2[3]); 
+                                               if(faceselectedAND(efa, 1)) glColor4ub(col2[0], col2[1], col2[2], col2[3]); 
                                                else glColor4ub(col1[0], col1[1], col1[2], col1[3]);
                                        
-                                               if(evl->v4 && evl->v4->h==0) {
+                                               if(efa->v4 && efa->v4->h==0) {
                                                
-                                                       CalcCent4f(cent, evl->v1->co, evl->v2->co, evl->v3->co, evl->v4->co);
+                                                       CalcCent4f(cent, efa->v1->co, efa->v2->co, efa->v3->co, efa->v4->co);
                                                        glBegin(GL_QUADS);
-                                                               VecMidf(fvec, cent, evl->v1->co); glVertex3fv(fvec);
-                                                               VecMidf(fvec, cent, evl->v2->co); glVertex3fv(fvec);
-                                                               VecMidf(fvec, cent, evl->v3->co); glVertex3fv(fvec);
-                                                               VecMidf(fvec, cent, evl->v4->co); glVertex3fv(fvec);
+                                                               VecMidf(fvec, cent, efa->v1->co); glVertex3fv(fvec);
+                                                               VecMidf(fvec, cent, efa->v2->co); glVertex3fv(fvec);
+                                                               VecMidf(fvec, cent, efa->v3->co); glVertex3fv(fvec);
+                                                               VecMidf(fvec, cent, efa->v4->co); glVertex3fv(fvec);
                                                        glEnd();
                                                }
                                                else {
        
-                                                       CalcCent3f(cent, evl->v1->co, evl->v2->co, evl->v3->co);
+                                                       CalcCent3f(cent, efa->v1->co, efa->v2->co, efa->v3->co);
                                                        glBegin(GL_TRIANGLES);
-                                                               VecMidf(fvec, cent, evl->v1->co); glVertex3fv(fvec);
-                                                               VecMidf(fvec, cent, evl->v2->co); glVertex3fv(fvec);
-                                                               VecMidf(fvec, cent, evl->v3->co); glVertex3fv(fvec);
+                                                               VecMidf(fvec, cent, efa->v1->co); glVertex3fv(fvec);
+                                                               VecMidf(fvec, cent, efa->v2->co); glVertex3fv(fvec);
+                                                               VecMidf(fvec, cent, efa->v3->co); glVertex3fv(fvec);
                                                        glEnd();
                                                }
                                        }
                                }
-                               evl= evl->next;
+                               efa= efa->next;
                        }
                        glDisable(GL_BLEND);
                        glDepthMask(1);         // restore write in zbuffer
@@ -2545,20 +2545,20 @@ static void drawmeshwire(Object *ob)
 
                        glBegin(GL_LINES);
                        
-                       evl= em->faces.first;
-                       while(evl) {
-                               if(evl->v1->h==0 && evl->v2->h==0 && evl->v3->h==0) {
-                                       if(evl->v4) CalcCent4f(fvec, evl->v1->co, evl->v2->co, evl->v3->co, evl->v4->co);
-                                       else CalcCent3f(fvec, evl->v1->co, evl->v2->co, evl->v3->co);
+                       efa= em->faces.first;
+                       while(efa) {
+                               if(efa->v1->h==0 && efa->v2->h==0 && efa->v3->h==0) {
+                                       if(efa->v4) CalcCent4f(fvec, efa->v1->co, efa->v2->co, efa->v3->co, efa->v4->co);
+                                       else CalcCent3f(fvec, efa->v1->co, efa->v2->co, efa->v3->co);
 
                                        glVertex3fv(fvec);
-                                       fvec[0]+= editbutsize*evl->n[0];
-                                       fvec[1]+= editbutsize*evl->n[1];
-                                       fvec[2]+= editbutsize*evl->n[2];
+                                       fvec[0]+= editbutsize*efa->n[0];
+                                       fvec[1]+= editbutsize*efa->n[1];
+                                       fvec[2]+= editbutsize*efa->n[2];
                                        glVertex3fv(fvec);
                                        
                                }
-                               evl= evl->next;
+                               efa= efa->next;
                        }
 
                        glEnd();
index c7ab61fb5aba41c6854fa8e4c36d057f4a2206b6..f6ed235798b9fa2f1a2e78032adb50a2a51d364a 100644 (file)
@@ -519,7 +519,7 @@ void countall()
        MetaElem *ml;
        /* struct BodyPoint *bop; */
        struct EditVert *eve;
-       struct EditVlak *evl;
+       struct EditFace *efa;
 #ifdef __NLA
        struct EditBone *ebo;
 #endif
@@ -538,14 +538,14 @@ void countall()
                                if(eve->f & 1) G.totvertsel++;
                                eve= eve->next;
                        }
-                       evl= em->faces.first;
-                       while(evl) {
+                       efa= em->faces.first;
+                       while(efa) {
                                G.totface++;
-                               if(evl->v1->f & 1) {
-                                       if(evl->v2->f & 1) {
-                                               if(evl->v3->f & 1) {
-                                                       if(evl->v4)  {
-                                                               if(evl->v4->f & 1) G.totfacesel++;
+                               if(efa->v1->f & 1) {
+                                       if(efa->v2->f & 1) {
+                                               if(efa->v3->f & 1) {
+                                                       if(efa->v4)  {
+                                                               if(efa->v4->f & 1) G.totfacesel++;
                                                        }
                                                        else {
                                                                G.totfacesel++;
@@ -553,7 +553,7 @@ void countall()
                                                }
                                        }
                                }
-                               evl= evl->next;
+                               efa= efa->next;
                        }
                }
 #ifdef __NLA
index 7e92fa24439ff8d46b05dcc458b0388c98b3eebb..ad1acb139fa56769c25db177d457cc95fed2ad85 100644 (file)
@@ -30,8 +30,6 @@
  * ***** END GPL/BL DUAL LICENSE BLOCK *****
  */
 
-/* main mesh editing routines. please note that 'vlak' is used here to denote a 'face'. */
-/* at that time for me a face was something at the frontside of a human head! (ton) */
 
 #include <stdlib.h>
 #include <string.h>
@@ -144,7 +142,7 @@ static float icovert[12][3] = {
        {178.885,0,89.443},
        {0,0,200}
 };
-static short icovlak[20][3] = {
+static short icoface[20][3] = {
        {1,0,2},
        {1,0,5},
        {2,0,3},
@@ -203,15 +201,15 @@ static int vergxco(const void *v1, const void *v2)
        return 0;
 }
 
-struct vlaksort {
+struct facesort {
        long x;
-       struct EditVlak *evl;
+       struct EditFace *efa;
 };
 
 
-static int vergvlak(const void *v1, const void *v2)
+static int vergface(const void *v1, const void *v2)
 {
-       const struct vlaksort *x1=v1, *x2=v2;
+       const struct facesort *x1=v1, *x2=v2;
        
        if( x1->x > x2->x ) return 1;
        else if( x1->x < x2->x) return -1;
@@ -373,7 +371,7 @@ EditEdge *addedgelist(EditVert *v1, EditVert *v2, EditEdge *example)
                eed->dir= swap;
                insert_hashedge(eed);
                /* copy edge data:
-                  rule is to do this with addedgelist call, before addvlaklist */
+                  rule is to do this with addedgelist call, before addfacelist */
                if(example) {
                        eed->crease= example->crease;
                        eed->seam = example->seam;
@@ -402,9 +400,9 @@ static void free_editedge(EditEdge *eed)
        free(eed);
 }
 
-static void free_editvlak(EditVlak *evl)
+static void free_editface(EditFace *efa)
 {
-       free(evl);
+       free(efa);
 }
 
 static void free_vertlist(ListBase *edve) 
@@ -435,23 +433,23 @@ static void free_edgelist(ListBase *lb)
        lb->first= lb->last= NULL;
 }
 
-static void free_vlaklist(ListBase *lb)
+static void free_facelist(ListBase *lb)
 {
-       EditVlak *evl, *next;
+       EditFace *efa, *next;
        
-       evl= lb->first;
-       while(evl) {
-               next= evl->next;
-               free_editvlak(evl);
-               evl= next;
+       efa= lb->first;
+       while(efa) {
+               next= efa->next;
+               free_editface(efa);
+               efa= next;
        }
        lb->first= lb->last= NULL;
 }
 
-EditVlak *addvlaklist(EditVert *v1, EditVert *v2, EditVert *v3, EditVert *v4, EditVlak *example)
+EditFace *addfacelist(EditVert *v1, EditVert *v2, EditVert *v3, EditVert *v4, EditFace *example)
 {
        EditMesh *em = G.editMesh;
-       EditVlak *evl;
+       EditFace *efa;
        EditEdge *e1, *e2=0, *e3=0, *e4=0;
 
        /* add face to list and do the edges */
@@ -464,42 +462,42 @@ EditVlak *addvlaklist(EditVert *v1, EditVert *v2, EditVert *v3, EditVert *v4, Ed
        if(v1==v2 || v2==v3 || v1==v3) return NULL;
        if(e2==0) return NULL;
 
-       evl= (EditVlak *)calloc(sizeof(EditVlak), 1);
-       evl->v1= v1;
-       evl->v2= v2;
-       evl->v3= v3;
-       evl->v4= v4;
+       efa= (EditFace *)calloc(sizeof(EditFace), 1);
+       efa->v1= v1;
+       efa->v2= v2;
+       efa->v3= v3;
+       efa->v4= v4;
 
-       evl->e1= e1;
-       evl->e2= e2;
-       evl->e3= e3;
-       evl->e4= e4;
+       efa->e1= e1;
+       efa->e2= e2;
+       efa->e3= e3;
+       efa->e4= e4;
 
        if(example) {
-               evl->mat_nr= example->mat_nr;
-               evl->tf= example->tf;
-               evl->flag= example->flag;
+               efa->mat_nr= example->mat_nr;
+               efa->tf= example->tf;
+               efa->flag= example->flag;
        }
        else {
                if (G.obedit && G.obedit->actcol)
-                       evl->mat_nr= G.obedit->actcol-1;
-               default_uv(evl->tf.uv, 1.0);
+                       efa->mat_nr= G.obedit->actcol-1;
+               default_uv(efa->tf.uv, 1.0);
 
                /* Initialize colors */
-               evl->tf.col[0]= evl->tf.col[1]= evl->tf.col[2]= evl->tf.col[3]= vpaint_get_current_col();
+               efa->tf.col[0]= efa->tf.col[1]= efa->tf.col[2]= efa->tf.col[3]= vpaint_get_current_col();
        }
 
-       BLI_addtail(&em->faces, evl);
+       BLI_addtail(&em->faces, efa);
 
-       if(evl->v4) CalcNormFloat4(v1->co, v2->co, v3->co, v4->co, evl->n);
-       else CalcNormFloat(v1->co, v2->co, v3->co, evl->n);
+       if(efa->v4) CalcNormFloat4(v1->co, v2->co, v3->co, v4->co, efa->n);
+       else CalcNormFloat(v1->co, v2->co, v3->co, efa->n);
 
-       return evl;
+       return efa;
 }
 
 /* ********* end add / new / find */
 
-static int comparevlak(EditVlak *vl1, EditVlak *vl2)
+static int compareface(EditFace *vl1, EditFace *vl2)
 {
        EditVert *v1, *v2, *v3, *v4;
        
@@ -536,42 +534,42 @@ static int comparevlak(EditVlak *vl1, EditVlak *vl2)
        return 0;
 }
 
-static int exist_vlak(EditVert *v1, EditVert *v2, EditVert *v3, EditVert *v4)
+static int exist_face(EditVert *v1, EditVert *v2, EditVert *v3, EditVert *v4)
 {
        EditMesh *em = G.editMesh;
-       EditVlak *evl, evltest;
+       EditFace *efa, efatest;
        
-       evltest.v1= v1;
-       evltest.v2= v2;
-       evltest.v3= v3;
-       evltest.v4= v4;
+       efatest.v1= v1;
+       efatest.v2= v2;
+       efatest.v3= v3;
+       efatest.v4= v4;
        
-       evl= em->faces.first;
-       while(evl) {
-               if(comparevlak(&evltest, evl)) return 1;
-               evl= evl->next;
+       efa= em->faces.first;
+       while(efa) {
+               if(compareface(&efatest, efa)) return 1;
+               efa= efa->next;
        }
        return 0;
 }
 
 
-static int vlakselectedOR(EditVlak *evl, int flag)
+static int faceselectedOR(EditFace *efa, int flag)
 {
        
-       if(evl->v1->f & flag) return 1;
-       if(evl->v2->f & flag) return 1;
-       if(evl->v3->f & flag) return 1;
-       if(evl->v4 && (evl->v4->f & 1)) return 1;
+       if(efa->v1->f & flag) return 1;
+       if(efa->v2->f & flag) return 1;
+       if(efa->v3->f & flag) return 1;
+       if(efa->v4 && (efa->v4->f & 1)) return 1;
        return 0;
 }
 
-int vlakselectedAND(EditVlak *evl, int flag)
+int faceselectedAND(EditFace *efa, int flag)
 {
-       if(evl->v1->f & flag) {
-               if(evl->v2->f & flag) {
-                       if(evl->v3->f & flag) {
-                               if(evl->v4) {
-                                       if(evl->v4->f & flag) return 1;
+       if(efa->v1->f & flag) {
+               if(efa->v2->f & flag) {
+                       if(efa->v3->f & flag) {
+                               if(efa->v4) {
+                                       if(efa->v4->f & flag) return 1;
                                }
                                else return 1;
                        }
@@ -583,75 +581,75 @@ int vlakselectedAND(EditVlak *evl, int flag)
 void recalc_editnormals(void)
 {
        EditMesh *em = G.editMesh;
-       EditVlak *evl;
+       EditFace *efa;
 
-       evl= em->faces.first;
-       while(evl) {
-               if(evl->v4) CalcNormFloat4(evl->v1->co, evl->v2->co, evl->v3->co, evl->v4->co, evl->n);
-               else CalcNormFloat(evl->v1->co, evl->v2->co, evl->v3->co, evl->n);
-               evl= evl->next;
+       efa= em->faces.first;
+       while(efa) {
+               if(efa->v4) CalcNormFloat4(efa->v1->co, efa->v2->co, efa->v3->co, efa->v4->co, efa->n);
+               else CalcNormFloat(efa->v1->co, efa->v2->co, efa->v3->co, efa->n);
+               efa= efa->next;
        }
 }
 
-static void flipvlak(EditVlak *evl)
+static void flipface(EditFace *efa)
 {
-       if(evl->v4) {
-               SWAP(EditVert *, evl->v2, evl->v4);
-               SWAP(EditEdge *, evl->e1, evl->e4);
-               SWAP(EditEdge *, evl->e2, evl->e3);
-               SWAP(unsigned int, evl->tf.col[1], evl->tf.col[3]);
-               SWAP(float, evl->tf.uv[1][0], evl->tf.uv[3][0]);
-               SWAP(float, evl->tf.uv[1][1], evl->tf.uv[3][1]);
+       if(efa->v4) {
+               SWAP(EditVert *, efa->v2, efa->v4);
+               SWAP(EditEdge *, efa->e1, efa->e4);
+               SWAP(EditEdge *, efa->e2, efa->e3);
+               SWAP(unsigned int, efa->tf.col[1], efa->tf.col[3]);
+               SWAP(float, efa->tf.uv[1][0], efa->tf.uv[3][0]);
+               SWAP(float, efa->tf.uv[1][1], efa->tf.uv[3][1]);
        }
        else {
-               SWAP(EditVert *, evl->v2, evl->v3);
-               SWAP(EditEdge *, evl->e1, evl->e3);
-               SWAP(unsigned int, evl->tf.col[1], evl->tf.col[2]);
-               evl->e2->dir= 1-evl->e2->dir;
-               SWAP(float, evl->tf.uv[1][0], evl->tf.uv[2][0]);
-               SWAP(float, evl->tf.uv[1][1], evl->tf.uv[2][1]);
+               SWAP(EditVert *, efa->v2, efa->v3);
+               SWAP(EditEdge *, efa->e1, efa->e3);
+               SWAP(unsigned int, efa->tf.col[1], efa->tf.col[2]);
+               efa->e2->dir= 1-efa->e2->dir;
+               SWAP(float, efa->tf.uv[1][0], efa->tf.uv[2][0]);
+               SWAP(float, efa->tf.uv[1][1], efa->tf.uv[2][1]);
        }
-       if(evl->v4) CalcNormFloat4(evl->v1->co, evl->v2->co, evl->v3->co, evl->v4->co, evl->n);
-       else CalcNormFloat(evl->v1->co, evl->v2->co, evl->v3->co, evl->n);
+       if(efa->v4) CalcNormFloat4(efa->v1->co, efa->v2->co, efa->v3->co, efa->v4->co, efa->n);
+       else CalcNormFloat(efa->v1->co, efa->v2->co, efa->v3->co, efa->n);
 }
 
 
 void flip_editnormals(void)
 {
        EditMesh *em = G.editMesh;
-       EditVlak *evl;
+       EditFace *efa;
        
-       evl= em->faces.first;
-       while(evl) {
-               if( vlakselectedAND(evl, 1) ) {
-                       flipvlak(evl);
+       efa= em->faces.first;
+       while(efa) {
+               if( faceselectedAND(efa, 1) ) {
+                       flipface(efa);
                }
-               evl= evl->next;
+               efa= efa->next;
        }
 }
 
 /* ************************ IN & OUT ***************************** */
 
-static void edge_normal_compare(EditEdge *eed, EditVlak *evl1)
+static void edge_normal_compare(EditEdge *eed, EditFace *efa1)
 {
-       EditVlak *evl2;
+       EditFace *efa2;
        float cent1[3], cent2[3];
        float inp;
        
-       evl2= (EditVlak *)eed->vn;
-       if(evl1==evl2) return;
+       efa2= (EditFace *)eed->vn;
+       if(efa1==efa2) return;
        
-       inp= evl1->n[0]*evl2->n[0] + evl1->n[1]*evl2->n[1] + evl1->n[2]*evl2->n[2];
+       inp= efa1->n[0]*efa2->n[0] + efa1->n[1]*efa2->n[1] + efa1->n[2]*efa2->n[2];
        if(inp<0.999 && inp >-0.999) eed->f= 1;
                
-       if(evl1->v4) CalcCent4f(cent1, evl1->v1->co, evl1->v2->co, evl1->v3->co, evl1->v4->co);
-       else CalcCent3f(cent1, evl1->v1->co, evl1->v2->co, evl1->v3->co);
-       if(evl2->v4) CalcCent4f(cent2, evl2->v1->co, evl2->v2->co, evl2->v3->co, evl2->v4->co);
-       else CalcCent3f(cent2, evl2->v1->co, evl2->v2->co, evl2->v3->co);
+       if(efa1->v4) CalcCent4f(cent1, efa1->v1->co, efa1->v2->co, efa1->v3->co, efa1->v4->co);
+       else CalcCent3f(cent1, efa1->v1->co, efa1->v2->co, efa1->v3->co);
+       if(efa2->v4) CalcCent4f(cent2, efa2->v1->co, efa2->v2->co, efa2->v3->co, efa2->v4->co);
+       else CalcCent3f(cent2, efa2->v1->co, efa2->v2->co, efa2->v3->co);
        
        VecSubf(cent1, cent2, cent1);
        Normalise(cent1);
-       inp= cent1[0]*evl1->n[0] + cent1[1]*evl1->n[1] + cent1[2]*evl1->n[2]; 
+       inp= cent1[0]*efa1->n[0] + cent1[1]*efa1->n[1] + cent1[2]*efa1->n[2]; 
 
        if(inp < -0.001 ) eed->f1= 1;
 }
@@ -661,7 +659,7 @@ static void edge_drawflags(void)
        EditMesh *em = G.editMesh;
        EditVert *eve;
        EditEdge *eed, *e1, *e2, *e3, *e4;
-       EditVlak *evl;
+       EditFace *efa;
        
        /* - count number of times edges are used in faces: 0 en 1 time means draw edge
         * - edges more than 1 time used: in *vn is pointer to first face
@@ -687,34 +685,34 @@ static void edge_drawflags(void)
                eed= eed->next;
        }
 
-       evl= em->faces.first;
-       while(evl) {
-               e1= evl->e1;
-               e2= evl->e2;
-               e3= evl->e3;
-               e4= evl->e4;
+       efa= em->faces.first;
+       while(efa) {
+               e1= efa->e1;
+               e2= efa->e2;
+               e3= efa->e3;
+               e4= efa->e4;
                if(e1->f<3) e1->f+= 1;
                if(e2->f<3) e2->f+= 1;
                if(e3->f<3) e3->f+= 1;
                if(e4 && e4->f<3) e4->f+= 1;
                
-               if(e1->vn==0) e1->vn= (EditVert *)evl;
-               if(e2->vn==0) e2->vn= (EditVert *)evl;
-               if(e3->vn==0) e3->vn= (EditVert *)evl;
-               if(e4 && e4->vn==0) e4->vn= (EditVert *)evl;
+               if(e1->vn==0) e1->vn= (EditVert *)efa;
+               if(e2->vn==0) e2->vn= (EditVert *)efa;
+               if(e3->vn==0) e3->vn= (EditVert *)efa;
+               if(e4 && e4->vn==0) e4->vn= (EditVert *)efa;
                
-               evl= evl->next;
+               efa= efa->next;
        }
 
        if(G.f & G_ALLEDGES) {
-               evl= em->faces.first;
-               while(evl) {
-                       if(evl->e1->f>=2) evl->e1->f= 1;
-                       if(evl->e2->f>=2) evl->e2->f= 1;
-                       if(evl->e3->f>=2) evl->e3->f= 1;
-                       if(evl->e4 && evl->e4->f>=2) evl->e4->f= 1;
+               efa= em->faces.first;
+               while(efa) {
+                       if(efa->e1->f>=2) efa->e1->f= 1;
+                       if(efa->e2->f>=2) efa->e2->f= 1;
+                       if(efa->e3->f>=2) efa->e3->f= 1;
+                       if(efa->e4 && efa->e4->f>=2) efa->e4->f= 1;
                        
-                       evl= evl->next;
+                       efa= efa->next;
                }               
        }       
        else {
@@ -728,14 +726,14 @@ static void edge_drawflags(void)
                }
 
                /* all faces, all edges with flag==2: compare normal */
-               evl= em->faces.first;
-               while(evl) {
-                       if(evl->e1->f==2) edge_normal_compare(evl->e1, evl);
-                       if(evl->e2->f==2) edge_normal_compare(evl->e2, evl);
-                       if(evl->e3->f==2) edge_normal_compare(evl->e3, evl);
-                       if(evl->e4 && evl->e4->f==2) edge_normal_compare(evl->e4, evl);
+               efa= em->faces.first;
+               while(efa) {
+                       if(efa->e1->f==2) edge_normal_compare(efa->e1, efa);
+                       if(efa->e2->f==2) edge_normal_compare(efa->e2, efa);
+                       if(efa->e3->f==2) edge_normal_compare(efa->e3, efa);
+                       if(efa->e4 && efa->e4->f==2) edge_normal_compare(efa->e4, efa);
                        
-                       evl= evl->next;
+                       efa= efa->next;
                }
                
                /* sphere collision flag */
@@ -768,7 +766,7 @@ void vertexnormals(int testflip)
        EditMesh *em = G.editMesh;
        Mesh *me;
        EditVert *eve;
-       EditVlak *evl;  
+       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 len;
@@ -799,15 +797,15 @@ void vertexnormals(int testflip)
        }
        
        /* calculate cosine angles and add to vertex normal */
-       evl= em->faces.first;
-       while(evl) {
-               VecSubf(n1, evl->v2->co, evl->v1->co);
-               VecSubf(n2, evl->v3->co, evl->v2->co);
+       efa= em->faces.first;
+       while(efa) {
+               VecSubf(n1, efa->v2->co, efa->v1->co);
+               VecSubf(n2, efa->v3->co, efa->v2->co);
                Normalise(n1);
                Normalise(n2);
 
-               if(evl->v4==0) {
-                       VecSubf(n3, evl->v1->co, evl->v3->co);
+               if(efa->v4==0) {
+                       VecSubf(n3, efa->v1->co, efa->v3->co);
                        Normalise(n3);
                        
                        co[0]= saacos(-n3[0]*n1[0]-n3[1]*n1[1]-n3[2]*n1[2]);
@@ -816,8 +814,8 @@ void vertexnormals(int testflip)
                        
                }
                else {
-                       VecSubf(n3, evl->v4->co, evl->v3->co);
-                       VecSubf(n4, evl->v1->co, evl->v4->co);
+                       VecSubf(n3, efa->v4->co, efa->v3->co);
+                       VecSubf(n4, efa->v1->co, efa->v4->co);
                        Normalise(n3);
                        Normalise(n4);
                        
@@ -827,33 +825,33 @@ void vertexnormals(int testflip)
                        co[3]= saacos(-n3[0]*n4[0]-n3[1]*n4[1]-n3[2]*n4[2]);
                }
                
-               temp= evl->v1->no;
-               if(testflip && contrpuntnorm(evl->n, temp) ) co[0]= -co[0];
-               temp[0]+= co[0]*evl->n[0];
-               temp[1]+= co[0]*evl->n[1];
-               temp[2]+= co[0]*evl->n[2];
+               temp= efa->v1->no;
+               if(testflip && contrpuntnorm(efa->n, temp) ) co[0]= -co[0];
+               temp[0]+= co[0]*efa->n[0];
+               temp[1]+= co[0]*efa->n[1];
+               temp[2]+= co[0]*efa->n[2];
                
-               temp= evl->v2->no;
-               if(testflip && contrpuntnorm(evl->n, temp) ) co[1]= -co[1];
-               temp[0]+= co[1]*evl->n[0];
-               temp[1]+= co[1]*evl->n[1];
-               temp[2]+= co[1]*evl->n[2];
+               temp= efa->v2->no;
+               if(testflip && contrpuntnorm(efa->n, temp) ) co[1]= -co[1];
+               temp[0]+= co[1]*efa->n[0];
+               temp[1]+= co[1]*efa->n[1];
+               temp[2]+= co[1]*efa->n[2];
                
-               temp= evl->v3->no;
-               if(testflip && contrpuntnorm(evl->n, temp) ) co[2]= -co[2];
-               temp[0]+= co[2]*evl->n[0];
-               temp[1]+= co[2]*evl->n[1];
-               temp[2]+= co[2]*evl->n[2];
+               temp= efa->v3->no;
+               if(testflip && contrpuntnorm(efa->n, temp) ) co[2]= -co[2];
+               temp[0]+= co[2]*efa->n[0];
+               temp[1]+= co[2]*efa->n[1];
+               temp[2]+= co[2]*efa->n[2];
                
-               if(evl->v4) {
-                       temp= evl->v4->no;
-                       if(testflip && contrpuntnorm(evl->n, temp) ) co[3]= -co[3];
-                       temp[0]+= co[3]*evl->n[0];
-                       temp[1]+= co[3]*evl->n[1];
-                       temp[2]+= co[3]*evl->n[2];
+               if(efa->v4) {
+                       temp= efa->v4->no;
+                       if(testflip && contrpuntnorm(efa->n, temp) ) co[3]= -co[3];
+                       temp[0]+= co[3]*efa->n[0];
+                       temp[1]+= co[3]*efa->n[1];
+                       temp[2]+= co[3]*efa->n[2];
                }
                
-               evl= evl->next;
+               efa= efa->next;
        }
 
        /* normalise vertex normals */
@@ -868,45 +866,45 @@ void vertexnormals(int testflip)
        }
        
        /* vertex normal flip-flags for shade (render) */
-       evl= em->faces.first;
-       while(evl) {
-               evl->f=0;                       
+       efa= em->faces.first;
+       while(efa) {
+               efa->f=0;                       
 
                if(testflip) {
-                       f1= evl->v1->no;
-                       f2= evl->v2->no;
-                       f3= evl->v3->no;
+                       f1= efa->v1->no;
+                       f2= efa->v2->no;
+                       f3= efa->v3->no;
                        
-                       fac1= evl->n[0]*f1[0] + evl->n[1]*f1[1] + evl->n[2]*f1[2];
+                       fac1= efa->n[0]*f1[0] + efa->n[1]*f1[1] + efa->n[2]*f1[2];
                        if(fac1<0.0) {
-                               evl->f = ME_FLIPV1;
+                               efa->f = ME_FLIPV1;
                        }
-                       fac2= evl->n[0]*f2[0] + evl->n[1]*f2[1] + evl->n[2]*f2[2];
+                       fac2= efa->n[0]*f2[0] + efa->n[1]*f2[1] + efa->n[2]*f2[2];
                        if(fac2<0.0) {
-                               evl->f += ME_FLIPV2;
+                               efa->f += ME_FLIPV2;
                        }
-                       fac3= evl->n[0]*f3[0] + evl->n[1]*f3[1] + evl->n[2]*f3[2];
+                       fac3= efa->n[0]*f3[0] + efa->n[1]*f3[1] + efa->n[2]*f3[2];
                        if(fac3<0.0) {
-                               evl->f += ME_FLIPV3;
+                               efa->f += ME_FLIPV3;
                        }
-                       if(evl->v4) {
-                               f4= evl->v4->no;
-                               fac4= evl->n[0]*f4[0] + evl->n[1]*f4[1] + evl->n[2]*f4[2];
+                       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) {
-                                       evl->f += ME_FLIPV4;
+                                       efa->f += ME_FLIPV4;
                                }
                        }
                }
                /* projection for cubemap! */
-               xn= fabs(evl->n[0]);
-               yn= fabs(evl->n[1]);
-               zn= fabs(evl->n[2]);
+               xn= fabs(efa->n[0]);
+               yn= fabs(efa->n[1]);
+               zn= fabs(efa->n[2]);
                
-               if(zn>xn && zn>yn) evl->f += ME_PROJXY;
-               else if(yn>xn && yn>zn) evl->f += ME_PROJXZ;
-               else evl->f += ME_PROJYZ;
+               if(zn>xn && zn>yn) efa->f += ME_PROJXY;
+               else if(yn>xn && yn>zn) efa->f += ME_PROJXZ;
+               else efa->f += ME_PROJYZ;
                
-               evl= evl->next;
+               efa= efa->next;
        }
 }
 
@@ -916,7 +914,7 @@ void free_editMesh(void)
        EditMesh *em = G.editMesh;
        if(em->verts.first) free_vertlist(&em->verts);
        if(em->edges.first) free_edgelist(&em->edges);
-       if(em->faces.first) free_vlaklist(&em->faces);
+       if(em->faces.first) free_facelist(&em->faces);
        free_hashedgetab();
        G.totvert= G.totface= 0;
 }
@@ -944,7 +942,7 @@ void make_editMesh_real(Mesh *me)
        MVert *mvert;
        KeyBlock *actkey=0;
        EditVert *eve, **evlist, *eve1, *eve2, *eve3, *eve4;
-       EditVlak *evl;
+       EditFace *efa;
        EditEdge *eed;
        int tot, a;
 
@@ -1039,14 +1037,14 @@ void make_editMesh_real(Mesh *me)
                        if(mface->v3) eve3= evlist[mface->v3]; else eve3= NULL;
                        if(mface->v4) eve4= evlist[mface->v4]; else eve4= NULL;
                        
-                       evl= addvlaklist(eve1, eve2, eve3, eve4, NULL);
+                       efa= addfacelist(eve1, eve2, eve3, eve4, NULL);
 
-                       if(evl) {
+                       if(efa) {
                        
-                               if(mcol) memcpy(evl->tf.col, mcol, 4*sizeof(int));
+                               if(mcol) memcpy(efa->tf.col, mcol, 4*sizeof(int));
 
                                if(me->tface) {
-                                       evl->tf= *tface;
+                                       efa->tf= *tface;
 
                                        if( tface->flag & TF_SELECT) {
                                                if(G.f & G_FACESELECT) {
@@ -1058,8 +1056,8 @@ void make_editMesh_real(Mesh *me)
                                        }
                                }
                        
-                               evl->mat_nr= mface->mat_nr;
-                               evl->flag= mface->flag;
+                               efa->mat_nr= mface->mat_nr;
+                               efa->flag= mface->flag;
                        }
 
                        if(me->tface) tface++;
@@ -1097,7 +1095,7 @@ void make_editMesh_real(Mesh *me)
   */
 
 
-static void fix_faceindices(MFace *mface, EditVlak *evl, int nr)
+static void fix_faceindices(MFace *mface, EditFace *efa, int nr)
 {
        int a;
        float tmpuv[2];
@@ -1130,15 +1128,15 @@ static void fix_faceindices(MFace *mface, EditVlak *evl, int nr)
                        SWAP(int, mface->v1, mface->v2);
                        SWAP(int, mface->v2, mface->v3);
                        /* rotate face UV coordinates, too */
-                       UVCOPY(tmpuv, evl->tf.uv[0]);
-                       UVCOPY(evl->tf.uv[0], evl->tf.uv[1]);
-                       UVCOPY(evl->tf.uv[1], evl->tf.uv[2]);
-                       UVCOPY(evl->tf.uv[2], tmpuv);
+                       UVCOPY(tmpuv, efa->tf.uv[0]);
+                       UVCOPY(efa->tf.uv[0], efa->tf.uv[1]);
+                       UVCOPY(efa->tf.uv[1], efa->tf.uv[2]);
+                       UVCOPY(efa->tf.uv[2], tmpuv);
                        /* same with vertex colours */
-                       tmpcol = evl->tf.col[0];
-                       evl->tf.col[0] = evl->tf.col[1];
-                       evl->tf.col[1] = evl->tf.col[2];
-                       evl->tf.col[2] = tmpcol;
+                       tmpcol = efa->tf.col[0];
+                       efa->tf.col[0] = efa->tf.col[1];
+                       efa->tf.col[1] = efa->tf.col[2];
+                       efa->tf.col[2] = tmpcol;
 
                        
                        a= mface->edcode;
@@ -1160,19 +1158,19 @@ static void fix_faceindices(MFace *mface, EditVlak *evl, int nr)
                        SWAP(int, mface->v1, mface->v3);
                        SWAP(int, mface->v2, mface->v4);
                        /* swap UV coordinates */
-                       UVCOPY(tmpuv, evl->tf.uv[0]);
-                       UVCOPY(evl->tf.uv[0], evl->tf.uv[2]);
-                       UVCOPY(evl->tf.uv[2], tmpuv);
-                       UVCOPY(tmpuv, evl->tf.uv[1]);
-                       UVCOPY(evl->tf.uv[1], evl->tf.uv[3]);
-                       UVCOPY(evl->tf.uv[3], tmpuv);
+                       UVCOPY(tmpuv, efa->tf.uv[0]);
+                       UVCOPY(efa->tf.uv[0], efa->tf.uv[2]);
+                       UVCOPY(efa->tf.uv[2], tmpuv);
+                       UVCOPY(tmpuv, efa->tf.uv[1]);
+                       UVCOPY(efa->tf.uv[1], efa->tf.uv[3]);
+                       UVCOPY(efa->tf.uv[3], tmpuv);
                        /* swap vertex colours */
-                       tmpcol = evl->tf.col[0];
-                       evl->tf.col[0] = evl->tf.col[2];
-                       evl->tf.col[2] = tmpcol;
-                       tmpcol = evl->tf.col[1];
-                       evl->tf.col[1] = evl->tf.col[3];
-                       evl->tf.col[3] = tmpcol;
+                       tmpcol = efa->tf.col[0];
+                       efa->tf.col[0] = efa->tf.col[2];
+                       efa->tf.col[2] = tmpcol;
+                       tmpcol = efa->tf.col[1];
+                       efa->tf.col[1] = efa->tf.col[3];
+                       efa->tf.col[3] = tmpcol;
 
                        a= mface->edcode;
                        mface->edcode= 0;
@@ -1217,7 +1215,7 @@ void load_editMesh_real(Mesh *me, int undo)
        MSticky *ms;
        KeyBlock *actkey=NULL, *currkey;
        EditVert *eve;
-       EditVlak *evl;
+       EditFace *efa;
        EditEdge *eed;
        float *fp, *newkey, *oldkey, nor[3];
        int i, a, ototvert, totedge=0;
@@ -1232,7 +1230,7 @@ void load_editMesh_real(Mesh *me, int undo)
        /* eve->f1 : flag for dynaface (sphere test, old engine) */
        edge_drawflags();
        
-       /* WATCH IT: in evl->f is punoflag (for vertex normal) */
+       /* WATCH IT: in efa->f is punoflag (for vertex normal) */
        vertexnormals( (me->flag & ME_NOPUNOFLIP)==0 );
                
        eed= em->edges.first;
@@ -1350,19 +1348,19 @@ void load_editMesh_real(Mesh *me, int undo)
        }
 
        /* the faces */
-       evl= em->faces.first;
+       efa= em->faces.first;
        i = 0;
-       while(evl) {
+       while(efa) {
                mface= &((MFace *) me->mface)[i];
                
-               mface->v1= (unsigned int) evl->v1->vn;
-               mface->v2= (unsigned int) evl->v2->vn;
-               mface->v3= (unsigned int) evl->v3->vn;
-               if(evl->v4) mface->v4= (unsigned int) evl->v4->vn;
+               mface->v1= (unsigned int) efa->v1->vn;
+               mface->v2= (unsigned int) efa->v2->vn;
+               mface->v3= (unsigned int) efa->v3->vn;
+               if(efa->v4) mface->v4= (unsigned int) efa->v4->vn;
                        
-               mface->mat_nr= evl->mat_nr;
-               mface->puno= evl->f;
-               mface->flag= evl->flag;
+               mface->mat_nr= efa->mat_nr;
+               mface->puno= efa->f;
+               mface->flag= efa->flag;
                        
                /* mat_nr in vertex */
                if(me->totcol>1) {
@@ -1378,37 +1376,37 @@ void load_editMesh_real(Mesh *me, int undo)
                        }
                }
                        
-               /* watch: evl->e1->f==0 means loose edge */ 
+               /* watch: efa->e1->f==0 means loose edge */ 
                        
-               if(evl->e1->f==1) {
+               if(efa->e1->f==1) {
                        mface->edcode |= ME_V1V2; 
-                       evl->e1->f= 2;
+                       efa->e1->f= 2;
                }                       
-               if(evl->e2->f==1) {
+               if(efa->e2->f==1) {
                        mface->edcode |= ME_V2V3; 
-                       evl->e2->f= 2;
+                       efa->e2->f= 2;
                }
-               if(evl->e3->f==1) {
-                       if(evl->v4) {
+               if(efa->e3->f==1) {
+                       if(efa->v4) {
                                mface->edcode |= ME_V3V4;
                        }
                        else {
                                mface->edcode |= ME_V3V1;
                        }
-                       evl->e3->f= 2;
+                       efa->e3->f= 2;
                }
-               if(evl->e4 && evl->e4->f==1) {
+               if(efa->e4 && efa->e4->f==1) {
                        mface->edcode |= ME_V4V1; 
-                       evl->e4->f= 2;
+                       efa->e4->f= 2;
                }
 
 
                /* no index '0' at location 3 or 4 */
-               if(evl->v4) fix_faceindices(mface, evl, 4);
-               else fix_faceindices(mface, evl, 3);
+               if(efa->v4) fix_faceindices(mface, efa, 4);
+               else fix_faceindices(mface, efa, 3);
                        
                i++;
-               evl= evl->next;
+               efa= efa->next;
        }
                
        /* add loose edges as a face */
@@ -1435,18 +1433,18 @@ void load_editMesh_real(Mesh *me, int undo)
                TFace *tfn, *tf;
                        
                tf=tfn= MEM_callocN(sizeof(TFace)*me->totface, "tface");
-               evl= em->faces.first;
-               while(evl) {
+               efa= em->faces.first;
+               while(efa) {
                                
-                       *tf= evl->tf;
+                       *tf= efa->tf;
                                
                        if(G.f & G_FACESELECT) {
-                               if( vlakselectedAND(evl, 1) ) tf->flag |= TF_SELECT;
+                               if( faceselectedAND(efa, 1) ) tf->flag |= TF_SELECT;
                                else tf->flag &= ~TF_SELECT;
                        }
                                
                        tf++;
-                       evl= evl->next;
+                       efa= efa->next;
                }
                /* if undo, me was empty */
                if(me->tface) MEM_freeN(me->tface);
@@ -1462,12 +1460,12 @@ void load_editMesh_real(Mesh *me, int undo)
                unsigned int *mcn, *mc;
 
                mc=mcn= MEM_mallocN(4*sizeof(int)*me->totface, "mcol");
-               evl= em->faces.first;
-               while(evl) {
-                       memcpy(mc, evl->tf.col, 4*sizeof(int));
+               efa= em->faces.first;
+               while(efa) {
+                       memcpy(mc, efa->tf.col, 4*sizeof(int));
                                
                        mc+=4;
-                       evl= evl->next;
+                       efa= efa->next;
                }
                if(me->mcol) MEM_freeN(me->mcol);
                        me->mcol= (MCol *)mcn;
@@ -1736,32 +1734,32 @@ void slowerdraw(void)           /* reset fasterdraw */
 void convert_to_triface(int all)
 {
        EditMesh *em = G.editMesh;
-       EditVlak *evl, *evln, *next;
+       EditFace *efa, *efan, *next;
        
        undo_push_mesh("Convert Quads to Triangles");
        
-       evl= em->faces.first;
-       while(evl) {
-               next= evl->next;
-               if(evl->v4) {
-                       if(all || vlakselectedAND(evl, 1) ) {
+       efa= em->faces.first;
+       while(efa) {
+               next= efa->next;
+               if(efa->v4) {
+                       if(all || faceselectedAND(efa, 1) ) {
                                
-                               evln= addvlaklist(evl->v1, evl->v2, evl->v3, 0, evl);
-                               evln= addvlaklist(evl->v1, evl->v3, evl->v4, 0, evl);
+                               efan= addfacelist(efa->v1, efa->v2, efa->v3, 0, efa);
+                               efan= addfacelist(efa->v1, efa->v3, efa->v4, 0, efa);
 
-                               evln->tf.uv[1][0]= evln->tf.uv[2][0];
-                               evln->tf.uv[1][1]= evln->tf.uv[2][1];
-                               evln->tf.uv[2][0]= evln->tf.uv[3][0];
-                               evln->tf.uv[2][1]= evln->tf.uv[3][1];
+                               efan->tf.uv[1][0]= efan->tf.uv[2][0];
+                               efan->tf.uv[1][1]= efan->tf.uv[2][1];
+                               efan->tf.uv[2][0]= efan->tf.uv[3][0];
+                               efan->tf.uv[2][1]= efan->tf.uv[3][1];
                                
-                               evln->tf.col[1]= evln->tf.col[2];
-                               evln->tf.col[2]= evln->tf.col[3];
+                               efan->tf.col[1]= efan->tf.col[2];
+                               efan->tf.col[2]= efan->tf.col[3];
                                
-                               BLI_remlink(&em->faces, evl);
-                               free_editvlak(evl);
+                               BLI_remlink(&em->faces, efa);
+                               free_editface(efa);
                        }
                }
-               evl= next;
+               efa= next;
        }
        
 }
@@ -1805,7 +1803,7 @@ void righthandfaces(int select)   /* makes faces righthand turning */
 {
        EditMesh *em = G.editMesh;
        EditEdge *eed, *ed1, *ed2, *ed3, *ed4;
-       EditVlak *evl, *startvl;
+       EditFace *efa, *startvl;
        float maxx, nor[3], cent[3];
        int totsel, found, foundone, direct, turn, tria_nr;
 
@@ -1834,51 +1832,51 @@ void righthandfaces(int select) /* makes faces righthand turning */
 
        /* count faces and edges */
        totsel= 0;
-       evl= em->faces.first;
-       while(evl) {
-               if(select==0 || vlakselectedAND(evl, 1) ) {
-                       evl->f= 1;
+       efa= em->faces.first;
+       while(efa) {
+               if(select==0 || faceselectedAND(efa, 1) ) {
+                       efa->f= 1;
                        totsel++;
-                       evl->e1->f1++;
-                       evl->e2->f1++;
-                       evl->e3->f1++;
-                       if(evl->v4) evl->e4->f1++;
+                       efa->e1->f1++;
+                       efa->e2->f1++;
+                       efa->e3->f1++;
+                       if(efa->v4) efa->e4->f1++;
                }
-               else evl->f= 0;
+               else efa->f= 0;
 
-               evl= evl->next;
+               efa= efa->next;
        }
 
        while(totsel>0) {
                /* from the outside to the inside */
 
-               evl= em->faces.first;
+               efa= em->faces.first;
                startvl= NULL;
                maxx= -1.0e10;
                tria_nr= 0;
 
-               while(evl) {
-                       if(evl->f) {
-                               CalcCent3f(cent, evl->v1->co, evl->v2->co, evl->v3->co);
+               while(efa) {
+                       if(efa->f) {
+                               CalcCent3f(cent, efa->v1->co, efa->v2->co, efa->v3->co);
                                cent[0]= cent[0]*cent[0] + cent[1]*cent[1] + cent[2]*cent[2];
                                
                                if(cent[0]>maxx) {
                                        maxx= cent[0];
-                                       startvl= evl;
+                                       startvl= efa;
                                        tria_nr= 0;
                                }
-                               if(evl->v4) {
-                                       CalcCent3f(cent, evl->v1->co, evl->v3->co, evl->v4->co);
+                               if(efa->v4) {
+                                       CalcCent3f(cent, efa->v1->co, efa->v3->co, efa->v4->co);
                                        cent[0]= cent[0]*cent[0] + cent[1]*cent[1] + cent[2]*cent[2];
                                        
                                        if(cent[0]>maxx) {
                                                maxx= cent[0];
-                                               startvl= evl;
+                                               startvl= efa;
                                                tria_nr= 1;
                                        }
                                }
                        }
-                       evl= evl->next;
+                       efa= efa->next;
                }
                
                /* set first face correct: calc normal */
@@ -1893,13 +1891,13 @@ void righthandfaces(int select) /* makes faces righthand turning */
                /* first normal is oriented this way or the other */
                if(select) {
                        if(select==2) {
-                               if(cent[0]*nor[0]+cent[1]*nor[1]+cent[2]*nor[2] > 0.0) flipvlak(startvl);
+                               if(cent[0]*nor[0]+cent[1]*nor[1]+cent[2]*nor[2] > 0.0) flipface(startvl);
                        }
                        else {
-                               if(cent[0]*nor[0]+cent[1]*nor[1]+cent[2]*nor[2] < 0.0) flipvlak(startvl);
+                               if(cent[0]*nor[0]+cent[1]*nor[1]+cent[2]*nor[2] < 0.0) flipface(startvl);
                        }
                }
-               else if(cent[0]*nor[0]+cent[1]*nor[1]+cent[2]*nor[2] < 0.0) flipvlak(startvl);
+               else if(cent[0]*nor[0]+cent[1]*nor[1]+cent[2]*nor[2] < 0.0) flipface(startvl);
 
 
                eed= startvl->e1;
@@ -1928,75 +1926,75 @@ void righthandfaces(int select) /* makes faces righthand turning */
                direct= 1;
                while(found) {
                        found= 0;
-                       if(direct) evl= em->faces.first;
-                       else evl= em->faces.last;
-                       while(evl) {
-                               if(evl->f) {
+                       if(direct) efa= em->faces.first;
+                       else efa= em->faces.last;
+                       while(efa) {
+                               if(efa->f) {
                                        turn= 0;
                                        foundone= 0;
 
-                                       ed1= evl->e1;
-                                       ed2= evl->e2;
-                                       ed3= evl->e3;
-                                       ed4= evl->e4;
+                                       ed1= efa->e1;
+                                       ed2= efa->e2;
+                                       ed3= efa->e3;
+                                       ed4= efa->e4;
 
                                        if(ed1->f) {
-                                               if(ed1->v1==evl->v1 && ed1->f==1) turn= 1;
-                                               if(ed1->v2==evl->v1 && ed1->f==2) turn= 1;
+                                               if(ed1->v1==efa->v1 && ed1->f==1) turn= 1;
+                                               if(ed1->v2==efa->v1 && ed1->f==2) turn= 1;
                                                foundone= 1;
                                        }
                                        else if(ed2->f) {
-                                               if(ed2->v1==evl->v2 && ed2->f==1) turn= 1;
-                                               if(ed2->v2==evl->v2 && ed2->f==2) turn= 1;
+                                               if(ed2->v1==efa->v2 && ed2->f==1) turn= 1;
+                                               if(ed2->v2==efa->v2 && ed2->f==2) turn= 1;
                                                foundone= 1;
                                        }
                                        else if(ed3->f) {
-                                               if(ed3->v1==evl->v3 && ed3->f==1) turn= 1;
-                                               if(ed3->v2==evl->v3 && ed3->f==2) turn= 1;
+                                               if(ed3->v1==efa->v3 && ed3->f==1) turn= 1;
+                                               if(ed3->v2==efa->v3 && ed3->f==2) turn= 1;
                                                foundone= 1;
                                        }
                                        else if(ed4 && ed4->f) {
-                                               if(ed4->v1==evl->v4 && ed4->f==1) turn= 1;
-                                               if(ed4->v2==evl->v4 && ed4->f==2) turn= 1;
+                                               if(ed4->v1==efa->v4 && ed4->f==1) turn= 1;
+                                               if(ed4->v2==efa->v4 && ed4->f==2) turn= 1;
                                                foundone= 1;
                                        }
 
                                        if(foundone) {
                                                found= 1;
                                                totsel--;
-                                               evl->f= 0;
+                                               efa->f= 0;
 
                                                if(turn) {
-                                                       if(ed1->v1==evl->v1) ed1->f= 2; 
+                                                       if(ed1->v1==efa->v1) ed1->f= 2; 
                                                        else ed1->f= 1;
-                                                       if(ed2->v1==evl->v2) ed2->f= 2; 
+                                                       if(ed2->v1==efa->v2) ed2->f= 2; 
                                                        else ed2->f= 1;
-                                                       if(ed3->v1==evl->v3) ed3->f= 2; 
+                                                       if(ed3->v1==efa->v3) ed3->f= 2; 
                                                        else ed3->f= 1;
                                                        if(ed4) {
-                                                               if(ed4->v1==evl->v4) ed4->f= 2; 
+                                                               if(ed4->v1==efa->v4) ed4->f= 2; 
                                                                else ed4->f= 1;
                                                        }
 
-                                                       flipvlak(evl);
+                                                       flipface(efa);
 
                                                }
                                                else {
-                                                       if(ed1->v1== evl->v1) ed1->f= 1; 
+                                                       if(ed1->v1== efa->v1) ed1->f= 1; 
                                                        else ed1->f= 2;
-                                                       if(ed2->v1==evl->v2) ed2->f= 1; 
+                                                       if(ed2->v1==efa->v2) ed2->f= 1; 
                                                        else ed2->f= 2;
-                                                       if(ed3->v1==evl->v3) ed3->f= 1; 
+                                                       if(ed3->v1==efa->v3) ed3->f= 1; 
                                                        else ed3->f= 2;
                                                        if(ed4) {
-                                                               if(ed4->v1==evl->v4) ed4->f= 1; 
+                                                               if(ed4->v1==efa->v4) ed4->f= 1; 
                                                                else ed4->f= 2;
                                                        }
                                                }
                                        }
                                }
-                               if(direct) evl= evl->next;
-                               else evl= evl->prev;
+                               if(direct) efa= efa->next;
+                               else efa= efa->prev;
                        }
                        direct= 1-direct;
                }
@@ -2267,7 +2265,7 @@ void loopoperations(char mode)
        EditEdge *start, *eed, *opposite,*currente, *oldstart;
        EditEdge **tagged = NULL,**taggedsrch = NULL,*close;
 
-       EditVlak *evl,**percentfacesloop = NULL, *currentvl,  *formervl;        
+       EditFace *efa,**percentfacesloop = NULL, *currentvl,  *formervl;        
 
        short lastface=0, foundedge=0, c=0, tri=0, side=1, totface=0, searching=1, event=0, noface=1;
        short skip,nextpos,percentfaces;
@@ -2292,7 +2290,7 @@ void loopoperations(char mode)
                
                /* reset variables */
                start=eed=opposite=currente=0;
-               evl=currentvl=formervl=0;
+               efa=currentvl=formervl=0;
                side=noface=1;
                lastface=foundedge=c=tri=totface=0;             
                                
@@ -2302,35 +2300,35 @@ void loopoperations(char mode)
                /* and only accept starting edge if it is part of at least one visible face */
                if(start){
                        start->f |= 16;
-                       evl=em->faces.first;
-                       while(evl){
-                               if(evl->e1->f & 16){
+                       efa=em->faces.first;
+                       while(efa){
+                               if(efa->e1->f & 16){
                                        /* since this edge is on the face, check if the face has any hidden verts */
-                                       if( !evl->v1->h && !evl->v2->h &&  !evl->v3->h && (evl->v4 && !evl->v4->h)  ){
+                                       if( !efa->v1->h && !efa->v2->h &&  !efa->v3->h && (efa->v4 && !efa->v4->h)  ){
                                                noface=0;
-                                               evl->e1->f &= ~16;
+                                               efa->e1->f &= ~16;
                                        }
                                }
-                               else if(evl->e2->f & 16){                                       
-                                       if( !evl->v1->h && !evl->v2->h &&  !evl->v3->h && (evl->v4 && !evl->v4->h)  ){
+                               else if(efa->e2->f & 16){                                       
+                                       if( !efa->v1->h && !efa->v2->h &&  !efa->v3->h && (efa->v4 && !efa->v4->h)  ){
                                                noface=0;
-                                               evl->e2->f &= ~16;
+                                               efa->e2->f &= ~16;
                                        }
                                }
-                               else if(evl->e3->f & 16){                                       
-                                       if( !evl->v1->h && !evl->v2->h &&  !evl->v3->h && (evl->v4 && !evl->v4->h)  ){
+                               else if(efa->e3->f & 16){                                       
+                                       if( !efa->v1->h && !efa->v2->h &&  !efa->v3->h && (efa->v4 && !efa->v4->h)  ){
                                                noface=0;
-                                               evl->e3->f &= ~16;
+                                               efa->e3->f &= ~16;
                                        }
                                }
-                               else if(evl->e4 && (evl->e4->f & 16)){                                  
-                                       if( !evl->v1->h && !evl->v2->h &&  !evl->v3->h && (evl->v4 && !evl->v4->h)  ){
+                               else if(efa->e4 && (efa->e4->f & 16)){                                  
+                                       if( !efa->v1->h && !efa->v2->h &&  !efa->v3->h && (efa->v4 && !efa->v4->h)  ){
                                                noface=0;
-                                               evl->e4->f &= ~16;
+                                               efa->e4->f &= ~16;
                                        }
                                }
                                
-                               evl=evl->next;
+                               efa=efa->next;
                        }                       
                }                               
                                
@@ -2347,8 +2345,8 @@ void loopoperations(char mode)
                                eed->v2->f &= ~(2|8|16);                                
                        }
                        
-                       for(evl= em->faces.first; evl; evl=evl->next){                  
-                               evl->f &= ~(4|8);
+                       for(efa= em->faces.first; efa; efa=efa->next){                  
+                               efa->f &= ~(4|8);
                                totface++;                              
                        }
                                        
@@ -2364,94 +2362,94 @@ void loopoperations(char mode)
                                
                                /*----------Get Loop------------------------*/
                                tri=foundedge=lastface=0;                                                                                                       
-                               evl= em->faces.first;           
-                               while(evl && !foundedge && !tri){
+                               efa= em->faces.first;           
+                               while(efa && !foundedge && !tri){
                                                                        
-                                       if(!(evl->v4)){ /* Exception for triangular faces */
+                                       if(!(efa->v4)){ /* Exception for triangular faces */
                                                
-                                               if((evl->e1->f | evl->e2->f | evl->e3->f) & 2){
-                                                       if(!(evl->f & 4)){                                                              
+                                               if((efa->e1->f | efa->e2->f | efa->e3->f) & 2){
+                                                       if(!(efa->f & 4)){                                                              
                                                                tri=1;
-                                                               currentvl=evl;
-                                                               if(side==1) evl->f |= 4;
+                                                               currentvl=efa;
+                                                               if(side==1) efa->f |= 4;
                                                        }
                                                }                                               
                                        }
                                        else{
                                                
-                                               if((evl->e1->f | evl->e2->f | evl->e3->f | evl->e4->f) & 2){
+                                               if((efa->e1->f | efa->e2->f | efa->e3->f | efa->e4->f) & 2){
                                                        
                                                        if(c==0){       /* just pick a face, doesn't matter wich side of the edge we go to */
-                                                               if(!(evl->f & 4)){
+                                                               if(!(efa->f & 4)){
                                                                        
-                                                                       if(!(evl->e1->v1->f & 2) && !(evl->e1->v2->f & 2)){
-                                                                               if(evl->e1->v1->h==0 && evl->e1->v2->h==0){
-                                                                                       opposite=evl->e1;                                                                                                               
+                                                                       if(!(efa->e1->v1->f & 2) && !(efa->e1->v2->f & 2)){
+                                                                               if(efa->e1->v1->h==0 && efa->e1->v2->h==0){
+                                                                                       opposite=efa->e1;                                                                                                               
                                                                                        foundedge=1;
                                                                                }
                                                                        }
-                                                                       else if(!(evl->e2->v1->f & 2) && !(evl->e2->v2->f & 2)){
-                                                                               if(evl->e2->v1->h==0 && evl->e2->v2->h==0){
-                                                                                       opposite=evl->e2;
+                                                                       else if(!(efa->e2->v1->f & 2) && !(efa->e2->v2->f & 2)){
+                                                                               if(efa->e2->v1->h==0 && efa->e2->v2->h==0){
+                                                                                       opposite=efa->e2;
                                                                                        foundedge=1;
                                                                                }
                                                                        }
-                                                                       else if(!(evl->e3->v1->f & 2) && !(evl->e3->v2->f & 2)){
-                                                                               if(evl->e3->v1->h==0 && evl->e3->v2->h==0){
-                                                                                       opposite=evl->e3;
+                                                                       else if(!(efa->e3->v1->f & 2) && !(efa->e3->v2->f & 2)){
+                                                                               if(efa->e3->v1->h==0 && efa->e3->v2->h==0){
+                                                                                       opposite=efa->e3;
                                                                                        foundedge=1;
                                                                                }
                                                                        }
-                                                                       else if(!(evl->e4->v1->f & 2) && !(evl->e4->v2->f & 2)){
-                                                                               if(evl->e4->v1->h==0 && evl->e4->v2->h==0){
-                                                                                       opposite=evl->e4;
+                                                                       else if(!(efa->e4->v1->f & 2) && !(efa->e4->v2->f & 2)){
+                                                                               if(efa->e4->v1->h==0 && efa->e4->v2->h==0){
+                                                                                       opposite=efa->e4;
                                                                                        foundedge=1;
                                                                                }
                                                                        }
                                                                        
                                                                        if(foundedge){
-                                                                               currentvl=evl;
-                                                                               formervl=evl;
+                                                                               currentvl=efa;
+                                                                               formervl=efa;
                                                                        
                                                                                /* mark this side of the edge so we know in which direction we went */
-                                                                               if(side==1) evl->f |= 4;
+                                                                               if(side==1) efa->f |= 4;
                                                                        }
                                                                }
                                                        }
                                                        else {  
-                                                               if(evl!=formervl){      /* prevent going backwards in the loop */
+                                                               if(efa!=formervl){      /* prevent going backwards in the loop */
                                                                
-                                                                       if(!(evl->e1->v1->f & 2) && !(evl->e1->v2->f & 2)){
-                                                                               if(evl->e1->v1->h==0 && evl->e1->v2->h==0){
-                                                                                       opposite=evl->e1;                                                                                                               
+                                                                       if(!(efa->e1->v1->f & 2) && !(efa->e1->v2->f & 2)){
+                                                                               if(efa->e1->v1->h==0 && efa->e1->v2->h==0){
+                                                                                       opposite=efa->e1;                                                                                                               
                                                                                        foundedge=1;
                                                                                }
                                                                        }
-                                                                       else if(!(evl->e2->v1->f & 2) && !(evl->e2->v2->f & 2)){
-                                                                               if(evl->e2->v1->h==0 && evl->e2->v2->h==0){
-                                                                                       opposite=evl->e2;
+                                                                       else if(!(efa->e2->v1->f & 2) && !(efa->e2->v2->f & 2)){
+                                                                               if(efa->e2->v1->h==0 && efa->e2->v2->h==0){
+                                                                                       opposite=efa->e2;
                                                                                        foundedge=1;
                                                                                }
                                                                        }
-                                                                       else if(!(evl->e3->v1->f & 2) && !(evl->e3->v2->f & 2)){
-                                                                               if(evl->e3->v1->h==0 && evl->e3->v2->h==0){
-                                                                                       opposite=evl->e3;
+                                                                       else if(!(efa->e3->v1->f & 2) && !(efa->e3->v2->f & 2)){
+                                                                               if(efa->e3->v1->h==0 && efa->e3->v2->h==0){
+                                                                                       opposite=efa->e3;
                                                                                        foundedge=1;
                                                                                }
                                                                        }
-                                                                       else if(!(evl->e4->v1->f & 2) && !(evl->e4->v2->f & 2)){
-                                                                               if(evl->e4->v1->h==0 && evl->e4->v2->h==0){
-                                                                                       opposite=evl->e4;
+                                                                       else if(!(efa->e4->v1->f & 2) && !(efa->e4->v2->f & 2)){
+                                                                               if(efa->e4->v1->h==0 && efa->e4->v2->h==0){
+                                                                                       opposite=efa->e4;
                                                                                        foundedge=1;
                                                                                }
                                                                        }
                                                                        
-                                                                       currentvl=evl;
+                                                                       currentvl=efa;
                                                                }
                                                        }
                                                }
                                        }
-                               evl=evl->next;
+                               efa=efa->next;
                                }
                                /*----------END Get Loop------------------------*/
                                
@@ -2529,116 +2527,116 @@ void loopoperations(char mode)
                        glColor3ub(255, 255, 0);
                        
                        if(mode==LOOP_SELECT){
-                               evl= em->faces.first;
-                               while(evl){
-                                       if(evl->f & 8){
+                               efa= em->faces.first;
+                               while(efa){
+                                       if(efa->f & 8){
                                                
-                                               if(!(evl->e1->f & 8)){
+                                               if(!(efa->e1->f & 8)){
                                                        glBegin(GL_LINES);                                                      
-                                                       glVertex3fv(evl->e1->v1->co);
-                                                       glVertex3fv(evl->e1->v2->co);
+                                                       glVertex3fv(efa->e1->v1->co);
+                                                       glVertex3fv(efa->e1->v2->co);
                                                        glEnd();        
                                                }
                                                
-                                               if(!(evl->e2->f & 8)){
+                                               if(!(efa->e2->f & 8)){
                                                        glBegin(GL_LINES);                                                      
-                                                       glVertex3fv(evl->e2->v1->co);
-                                                       glVertex3fv(evl->e2->v2->co);
+                                                       glVertex3fv(efa->e2->v1->co);
+                                                       glVertex3fv(efa->e2->v2->co);
                                                        glEnd();        
                                                }
                                                
-                                               if(!(evl->e3->f & 8)){
+                                               if(!(efa->e3->f & 8)){
                                                        glBegin(GL_LINES);                                                      
-                                                       glVertex3fv(evl->e3->v1->co);
-                                                       glVertex3fv(evl->e3->v2->co);
+                                                       glVertex3fv(efa->e3->v1->co);
+                                                       glVertex3fv(efa->e3->v2->co);
                                                        glEnd();        
                                                }
                                                
-                                               if(evl->e4){
-                                                       if(!(evl->e4->f & 8)){
+                                               if(efa->e4){
+                                                       if(!(efa->e4->f & 8)){
                                                                glBegin(GL_LINES);                                                      
-                                                               glVertex3fv(evl->e4->v1->co);
-                                                               glVertex3fv(evl->e4->v2->co);
+                                                               glVertex3fv(efa->e4->v1->co);
+                                                               glVertex3fv(efa->e4->v2->co);
                                                                glEnd();        
                                                        }
                                                }
                                        }
-                                       evl=evl->next;
+                                       efa=efa->next;
                                }
                        }
                                
                        if(mode==LOOP_CUT){
-                               evl= em->faces.first;
-                               while(evl){
-                                       if(evl->f & 8){
+                               efa= em->faces.first;
+                               while(efa){
+                                       if(efa->f & 8){
                                                float cen[2][3];
                                                int a=0;                                                
                                                
-                                               evl->v1->f &= ~8;
-                                               evl->v2->f &= ~8;
-                                               evl->v3->f &= ~8;
-                                               if(evl->v4)evl->v4->f &= ~8;
+                                               efa->v1->f &= ~8;
+                                               efa->v2->f &= ~8;
+                                               efa->v3->f &= ~8;
+                                               if(efa->v4)efa->v4->f &= ~8;
                                        
-                                               if(evl->e1->f & 8){
-                                                       cen[a][0]= (evl->e1->v1->co[0] + evl->e1->v2->co[0])/2.0;
-                                                       cen[a][1]= (evl->e1->v1->co[1] + evl->e1->v2->co[1])/2.0;
-                                                       cen[a][2]= (evl->e1->v1->co[2] + evl->e1->v2->co[2])/2.0;
+                                               if(efa->e1->f & 8){
+                                                       cen[a][0]= (efa->e1->v1->co[0] + efa->e1->v2->co[0])/2.0;
+                                                       cen[a][1]= (efa->e1->v1->co[1] + efa->e1->v2->co[1])/2.0;
+                                                       cen[a][2]= (efa->e1->v1->co[2] + efa->e1->v2->co[2])/2.0;
                                                        
-                                                       evl->e1->v1->f |= 8;
-                                                       evl->e1->v2->f |= 8;
+                                                       efa->e1->v1->f |= 8;
+                                                       efa->e1->v2->f |= 8;
                                                        
                                                        a++;
                                                }
-                                               if((evl->e2->f & 8) && a!=2){
-                                                       cen[a][0]= (evl->e2->v1->co[0] + evl->e2->v2->co[0])/2.0;
-                                                       cen[a][1]= (evl->e2->v1->co[1] + evl->e2->v2->co[1])/2.0;
-                                                       cen[a][2]= (evl->e2->v1->co[2] + evl->e2->v2->co[2])/2.0;
+                                               if((efa->e2->f & 8) && a!=2){
+                                                       cen[a][0]= (efa->e2->v1->co[0] + efa->e2->v2->co[0])/2.0;
+                                                       cen[a][1]= (efa->e2->v1->co[1] + efa->e2->v2->co[1])/2.0;
+                                                       cen[a][2]= (efa->e2->v1->co[2] + efa->e2->v2->co[2])/2.0;
                                                        
-                                                       evl->e2->v1->f |= 8;
-                                                       evl->e2->v2->f |= 8;
+                                                       efa->e2->v1->f |= 8;
+                                                       efa->e2->v2->f |= 8;
                                                        
                                                        a++;
                                                }
-                                               if((evl->e3->f & 8) && a!=2){
-                                                       cen[a][0]= (evl->e3->v1->co[0] + evl->e3->v2->co[0])/2.0;
-                                                       cen[a][1]= (evl->e3->v1->co[1] + evl->e3->v2->co[1])/2.0;
-                                                       cen[a][2]= (evl->e3->v1->co[2] + evl->e3->v2->co[2])/2.0;
+                                               if((efa->e3->f & 8) && a!=2){
+                                                       cen[a][0]= (efa->e3->v1->co[0] + efa->e3->v2->co[0])/2.0;
+                                                       cen[a][1]= (efa->e3->v1->co[1] + efa->e3->v2->co[1])/2.0;
+                                                       cen[a][2]= (efa->e3->v1->co[2] + efa->e3->v2->co[2])/2.0;
                                                        
-                                                       evl->e3->v1->f |= 8;
-                                                       evl->e3->v2->f |= 8;
+                                                       efa->e3->v1->f |= 8;
+                                                       efa->e3->v2->f |= 8;
                                                        
                                                        a++;
                                                }
                                                
-                                               if(evl->e4){
-                                                       if((evl->e4->f & 8) && a!=2){
-                                                               cen[a][0]= (evl->e4->v1->co[0] + evl->e4->v2->co[0])/2.0;
-                                                               cen[a][1]= (evl->e4->v1->co[1] + evl->e4->v2->co[1])/2.0;
-                                                               cen[a][2]= (evl->e4->v1->co[2] + evl->e4->v2->co[2])/2.0;
+                                               if(efa->e4){
+                                                       if((efa->e4->f & 8) && a!=2){
+                                                               cen[a][0]= (efa->e4->v1->co[0] + efa->e4->v2->co[0])/2.0;
+                                                               cen[a][1]= (efa->e4->v1->co[1] + efa->e4->v2->co[1])/2.0;
+                                                               cen[a][2]= (efa->e4->v1->co[2] + efa->e4->v2->co[2])/2.0;
                                                                
-                                                               evl->e4->v1->f |= 8;
-                                                               evl->e4->v2->f |= 8;
+                                                               efa->e4->v1->f |= 8;
+                                                               efa->e4->v2->f |= 8;
                                                        
                                                                a++;
                                                        }
                                                }
                                                else{   /* if it's a triangular face, set the remaining vertex as the cutcurve coordinate */                                                                                                            
-                                                               if(!(evl->v1->f & 8) && evl->v1->h==0){
-                                                                       cen[a][0]= evl->v1->co[0];
-                                                                       cen[a][1]= evl->v1->co[1];
-                                                                       cen[a][2]= evl->v1->co[2];
+                                                               if(!(efa->v1->f & 8) && efa->v1->h==0){
+                                                                       cen[a][0]= efa->v1->co[0];
+                                                                       cen[a][1]= efa->v1->co[1];
+                                                                       cen[a][2]= efa->v1->co[2];
                                                                        a++;                                                            
                                                                }
-                                                               else if(!(evl->v2->f & 8) && evl->v2->h==0){
-                                                                       cen[a][0]= evl->v2->co[0];
-                                                                       cen[a][1]= evl->v2->co[1];
-                                                                       cen[a][2]= evl->v2->co[2];      
+                                                               else if(!(efa->v2->f & 8) && efa->v2->h==0){
+                                                                       cen[a][0]= efa->v2->co[0];
+                                                                       cen[a][1]= efa->v2->co[1];
+                                                                       cen[a][2]= efa->v2->co[2];      
                                                                        a++;
                                                                }
-                                                               else if(!(evl->v3->f & 8) && evl->v3->h==0){
-                                                                       cen[a][0]= evl->v3->co[0];
-                                                                       cen[a][1]= evl->v3->co[1];
-                                                                       cen[a][2]= evl->v3->co[2];
+                                                               else if(!(efa->v3->f & 8) && efa->v3->h==0){
+                                                                       cen[a][0]= efa->v3->co[0];
+                                                                       cen[a][1]= efa->v3->co[1];
+                                                                       cen[a][2]= efa->v3->co[2];
                                                                        a++;                                                                    
                                                                }                                                       
                                                }
@@ -2652,7 +2650,7 @@ void loopoperations(char mode)
                                                        glEnd();
                                                }                                               
                                        }
-                                       evl=evl->next;
+                                       efa=efa->next;
                                }
                                
                                eed=em->edges.first; 
@@ -2699,33 +2697,33 @@ void loopoperations(char mode)
                                
                /* If this is a unmodified select, clear the selection */
                if(!(G.qual & LR_SHIFTKEY) && !(G.qual & LR_ALTKEY)){
-                       for(evl= em->faces.first;evl;evl=evl->next){
-                               evl->v1->f &= !1;
-                               evl->v2->f &= !1;
-                               evl->v3->f &= !1;
-                               if(evl->v4)evl->v4->f &= !1;                    
+                       for(efa= em->faces.first;efa;efa=efa->next){
+                               efa->v1->f &= !1;
+                               efa->v2->f &= !1;
+                               efa->v3->f &= !1;
+                               if(efa->v4)efa->v4->f &= !1;                    
                        }
                }
                /* Alt was not pressed, so add to the selection */
                if(!(G.qual & LR_ALTKEY)){
-                       for(evl= em->faces.first;evl;evl=evl->next){
-                               if(evl->f & 8){
-                                       evl->v1->f |= 1;
-                                       evl->v2->f |= 1;
-                                       evl->v3->f |= 1;
-                                       if(evl->v4)evl->v4->f |= 1;
+                       for(efa= em->faces.first;efa;efa=efa->next){
+                               if(efa->f & 8){
+                                       efa->v1->f |= 1;
+                                       efa->v2->f |= 1;
+                                       efa->v3->f |= 1;
+                                       if(efa->v4)efa->v4->f |= 1;
                                }
                        }
                }
                /* alt was pressed, so subtract from the selection */
                else
                {
-                       for(evl= em->faces.first;evl;evl=evl->next){
-                               if(evl->f & 8){
-                                       evl->v1->f &= !1;
-                                       evl->v2->f &= !1;
-                                       evl->v3->f &= !1;
-                                       if(evl->v4)evl->v4->f &= !1;
+                       for(efa= em->faces.first;efa;efa=efa->next){
+                               if(efa->f & 8){
+                                       efa->v1->f &= !1;
+                                       efa->v2->f &= !1;
+                                       efa->v3->f &= !1;
+                                       if(efa->v4)efa->v4->f &= !1;
                                }
                        }
                }
@@ -2833,22 +2831,22 @@ void loopoperations(char mode)
 
                /* Count the Number of Faces in the selected loop*/
                percentfaces = 0;
-               for(evl= em->faces.first; evl ;evl=evl->next){
-                       if(evl->f & 8)
+               for(efa= em->faces.first; efa ;efa=efa->next){
+                       if(efa->f & 8)
                         {
                                percentfaces++; 
                         }
                }
                        
                /* create a dynamic array for those face pointers */
-               percentfacesloop = MEM_mallocN(percentfaces*sizeof(EditVlak*), "percentage");
+               percentfacesloop = MEM_mallocN(percentfaces*sizeof(EditFace*), "percentage");
 
                /* put those faces in the array */
                i=0;
-               for(evl= em->faces.first; evl ;evl=evl->next){
-                        if(evl->f & 8)
+               for(efa= em->faces.first; efa ;efa=efa->next){
+                        if(efa->f & 8)
                         {
-                               percentfacesloop[i] = evl;      
+                               percentfacesloop[i] = efa;      
                                i++;
                         }
                }
@@ -2870,7 +2868,7 @@ void loopoperations(char mode)
                        /*Put the preview lines where they should be for the percentage selected.*/
 
                        for(i=0;i<percentfaces;i++){
-                               evl = percentfacesloop[i];
+                               efa = percentfacesloop[i];
                                for(eed = em->edges.first; eed; eed=eed->next){
                                        if(eed->f & 64){        /* color the starting edge */                   
                                                glBegin(GL_LINES);
@@ -2901,95 +2899,95 @@ void loopoperations(char mode)
                                
                                if(!inset){
                                        glColor3ub(0,255,255);
-                                       if(evl->f & 8)
+                                       if(efa->f & 8)
                                        {
                                                float cen[2][3];
                                                int a=0;                                        
                                                
-                                               evl->v1->f &= ~8;
-                                               evl->v2->f &= ~8;
-                                               evl->v3->f &= ~8;
-                                               if(evl->v4)evl->v4->f &= ~8;
+                                               efa->v1->f &= ~8;
+                                               efa->v2->f &= ~8;
+                                               efa->v3->f &= ~8;
+                                               if(efa->v4)efa->v4->f &= ~8;
                                                
-                                               if(evl->e1->f & 8){
+                                               if(efa->e1->f & 8){
                                                        float pct;
-                                                       if(evl->e1->f & 32)
+                                                       if(efa->e1->f & 32)
                                                                pct = 1-percentcut;
                                                        else
                                                                pct = percentcut;
-                                                       cen[a][0]= evl->e1->v1->co[0] - ((evl->e1->v1->co[0] - evl->e1->v2->co[0]) * (pct));
-                                                       cen[a][1]= evl->e1->v1->co[1] - ((evl->e1->v1->co[1] - evl->e1->v2->co[1]) * (pct));
-                                                       cen[a][2]= evl->e1->v1->co[2] - ((evl->e1->v1->co[2] - evl->e1->v2->co[2]) * (pct));
-                                                       evl->e1->v1->f |= 8;
-                                                       evl->e1->v2->f |= 8;
+                                                       cen[a][0]= efa->e1->v1->co[0] - ((efa->e1->v1->co[0] - efa->e1->v2->co[0]) * (pct));
+                                                       cen[a][1]= efa->e1->v1->co[1] - ((efa->e1->v1->co[1] - efa->e1->v2->co[1]) * (pct));
+                                                       cen[a][2]= efa->e1->v1->co[2] - ((efa->e1->v1->co[2] - efa->e1->v2->co[2]) * (pct));
+                                                       efa->e1->v1->f |= 8;
+                                                       efa->e1->v2->f |= 8;
                                                        a++;
                                                }
-                                               if((evl->e2->f & 8) && a!=2)
+                                               if((efa->e2->f & 8) && a!=2)
                                                {
                                                        float pct;
-                                                       if(evl->e2->f & 32)
+                                                       if(efa->e2->f & 32)
                                                                pct = 1-percentcut;
                                                        else
                                                                pct = percentcut;
-                                                       cen[a][0]= evl->e2->v1->co[0] - ((evl->e2->v1->co[0] - evl->e2->v2->co[0]) * (pct));
-                                                       cen[a][1]= evl->e2->v1->co[1] - ((evl->e2->v1->co[1] - evl->e2->v2->co[1]) * (pct));
-                                                       cen[a][2]= evl->e2->v1->co[2] - ((evl->e2->v1->co[2] - evl->e2->v2->co[2]) * (pct));
+                                                       cen[a][0]= efa->e2->v1->co[0] - ((efa->e2->v1->co[0] - efa->e2->v2->co[0]) * (pct));
+                                                       cen[a][1]= efa->e2->v1->co[1] - ((efa->e2->v1->co[1] - efa->e2->v2->co[1]) * (pct));
+                                                       cen[a][2]= efa->e2->v1->co[2] - ((efa->e2->v1->co[2] - efa->e2->v2->co[2]) * (pct));
 
-                                                       evl->e2->v1->f |= 8;
-                                                       evl->e2->v2->f |= 8;
+                                                       efa->e2->v1->f |= 8;
+                                                       efa->e2->v2->f |= 8;
                                                        
                                                        a++;
                                                }
-                                               if((evl->e3->f & 8) && a!=2){
+                                               if((efa->e3->f & 8) && a!=2){
                                                        float pct;
-                                                       if(evl->e3->f & 32)
+                                                       if(efa->e3->f & 32)
                                                                pct = 1-percentcut;
                                                        else
                                                                pct = percentcut;
-                                                       cen[a][0]= evl->e3->v1->co[0] - ((evl->e3->v1->co[0] - evl->e3->v2->co[0]) * (pct));
-                                                       cen[a][1]= evl->e3->v1->co[1] - ((evl->e3->v1->co[1] - evl->e3->v2->co[1]) * (pct));
-                                                       cen[a][2]= evl->e3->v1->co[2] - ((evl->e3->v1->co[2] - evl->e3->v2->co[2]) * (pct));
+                                                       cen[a][0]= efa->e3->v1->co[0] - ((efa->e3->v1->co[0] - efa->e3->v2->co[0]) * (pct));
+                                                       cen[a][1]= efa->e3->v1->co[1] - ((efa->e3->v1->co[1] - efa->e3->v2->co[1]) * (pct));
+                                                       cen[a][2]= efa->e3->v1->co[2] - ((efa->e3->v1->co[2] - efa->e3->v2->co[2]) * (pct));
 
-                                                       evl->e3->v1->f |= 8;
-                                                       evl->e3->v2->f |= 8;
+                                                       efa->e3->v1->f |= 8;
+                                                       efa->e3->v2->f |= 8;
                                                        
                                                        a++;
                                                }
                                                        
-                                               if(evl->e4){
-                                                       if((evl->e4->f & 8) && a!=2){
+                                               if(efa->e4){
+                                                       if((efa->e4->f & 8) && a!=2){
                                                                float pct;
-                                                               if(evl->e4->f & 32)
+                                                               if(efa->e4->f & 32)
                                                                        pct = 1-percentcut;
                                                                else
                                                                        pct = percentcut;
-                                                               cen[a][0]= evl->e4->v1->co[0] - ((evl->e4->v1->co[0] - evl->e4->v2->co[0]) * (pct));
-                                                               cen[a][1]= evl->e4->v1->co[1] - ((evl->e4->v1->co[1] - evl->e4->v2->co[1]) * (pct));
-                                                               cen[a][2]= evl->e4->v1->co[2] - ((evl->e4->v1->co[2] - evl->e4->v2->co[2]) * (pct));
+                                                               cen[a][0]= efa->e4->v1->co[0] - ((efa->e4->v1->co[0] - efa->e4->v2->co[0]) * (pct));
+                                                               cen[a][1]= efa->e4->v1->co[1] - ((efa->e4->v1->co[1] - efa->e4->v2->co[1]) * (pct));
+                                                               cen[a][2]= efa->e4->v1->co[2] - ((efa->e4->v1->co[2] - efa->e4->v2->co[2]) * (pct));
 
-                                                               evl->e4->v1->f |= 8;
-                                                               evl->e4->v2->f |= 8;
+                                                               efa->e4->v1->f |= 8;
+                                                               efa->e4->v2->f |= 8;
                                                        
                                                                a++;
                                                        }
                                                }
                                                else {  /* if it's a triangular face, set the remaining vertex as the cutcurve coordinate */
-                                                       if(!(evl->v1->f & 8) && evl->v1->h==0){
-                                                               cen[a][0]= evl->v1->co[0];
-                                                               cen[a][1]= evl->v1->co[1];
-                                                               cen[a][2]= evl->v1->co[2];
+                                                       if(!(efa->v1->f & 8) && efa->v1->h==0){
+                                                               cen[a][0]= efa->v1->co[0];
+                                                               cen[a][1]= efa->v1->co[1];
+                                                               cen[a][2]= efa->v1->co[2];
                                                                a++;                                                            
                                                        }
-                                                       else if(!(evl->v2->f & 8) && evl->v2->h==0){
-                                                               cen[a][0]= evl->v2->co[0];
-                                                               cen[a][1]= evl->v2->co[1];
-                                                               cen[a][2]= evl->v2->co[2];
+                                                       else if(!(efa->v2->f & 8) && efa->v2->h==0){
+                                                               cen[a][0]= efa->v2->co[0];
+                                                               cen[a][1]= efa->v2->co[1];
+                                                               cen[a][2]= efa->v2->co[2];
                                                                a++;                                                            
                                                        }
-                                                       else if(!(evl->v3->f & 8) && evl->v3->h==0){
-                                                               cen[a][0]= evl->v3->co[0];
-                                                               cen[a][1]= evl->v3->co[1];
-                                                               cen[a][2]= evl->v3->co[2];
+                                                       else if(!(efa->v3->f & 8) && efa->v3->h==0){
+                                                               cen[a][0]= efa->v3->co[0];
+                                                               cen[a][1]= efa->v3->co[1];
+                                                               cen[a][2]= efa->v3->co[2];
                                                                a++;                                                                                                    
                                                        }
                                                }
@@ -3006,113 +3004,113 @@ void loopoperations(char mode)
                                }/* end preview line drawing */                 
                                else{
                                        glColor3ub(0,128,255);
-                                       if(evl->f & 8)
+                                       if(efa->f & 8)
                                        {
                                                float cen[2][3];
                                                int a=0;                                        
                                                
-                                               evl->v1->f &= ~8;
-                                               evl->v2->f &= ~8;
-                                               evl->v3->f &= ~8;
-                                               if(evl->v4)evl->v4->f &= ~8;
+                                               efa->v1->f &= ~8;
+                                               efa->v2->f &= ~8;
+                                               efa->v3->f &= ~8;
+                                               if(efa->v4)efa->v4->f &= ~8;
                                                
-                                               if(evl->e1->f & 8){                                                     
+                                               if(efa->e1->f & 8){                                                     
                                                        float nlen,npct;
                                                        
-                                                       nlen = sqrt((evl->e1->v1->co[0] - evl->e1->v2->co[0])*(evl->e1->v1->co[0] - evl->e1->v2->co[0])+
-                                                                               (evl->e1->v1->co[1] - evl->e1->v2->co[1])*(evl->e1->v1->co[1] - evl->e1->v2->co[1])+
-                                                                               (evl->e1->v1->co[2] - evl->e1->v2->co[2])*(evl->e1->v1->co[2] - evl->e1->v2->co[2]));
+                                                       nlen = sqrt((efa->e1->v1->co[0] - efa->e1->v2->co[0])*(efa->e1->v1->co[0] - efa->e1->v2->co[0])+
+                                                                               (efa->e1->v1->co[1] - efa->e1->v2->co[1])*(efa->e1->v1->co[1] - efa->e1->v2->co[1])+
+                                                                               (efa->e1->v1->co[2] - efa->e1->v2->co[2])*(efa->e1->v1->co[2] - efa->e1->v2->co[2]));
                                                        npct = (percentcut*slen)/nlen;
                                                        if(npct >= 1) npct = 1;
-                                                       if(evl->e1->f & 32)     npct = 1-npct;
+                                                       if(efa->e1->f & 32)     npct = 1-npct;
 
-                                                       cen[a][0]= evl->e1->v1->co[0] - ((evl->e1->v1->co[0] - evl->e1->v2->co[0]) * (npct));
-                                                       cen[a][1]= evl->e1->v1->co[1] - ((evl->e1->v1->co[1] - evl->e1->v2->co[1]) * (npct));
-                                                       cen[a][2]= evl->e1->v1->co[2] - ((evl->e1->v1->co[2] - evl->e1->v2->co[2]) * (npct));
+                                                       cen[a][0]= efa->e1->v1->co[0] - ((efa->e1->v1->co[0] - efa->e1->v2->co[0]) * (npct));
+                                                       cen[a][1]= efa->e1->v1->co[1] - ((efa->e1->v1->co[1] - efa->e1->v2->co[1]) * (npct));
+                                                       cen[a][2]= efa->e1->v1->co[2] - ((efa->e1->v1->co[2] - efa->e1->v2->co[2]) * (npct));
 
-                                                       evl->e1->f1 = 32768*(npct);
-                                                       evl->e1->v1->f |= 8;
-                                                       evl->e1->v2->f |= 8;
+                                                       efa->e1->f1 = 32768*(npct);
+                                                       efa->e1->v1->f |= 8;
+                                                       efa->e1->v2->f |= 8;
                                                        a++;
                                                }
-                                               if((evl->e2->f & 8) && a!=2)
+                                               if((efa->e2->f & 8) && a!=2)
                                                {
                                                        float nlen,npct;
                                                        
-                                                       nlen = sqrt((evl->e2->v1->co[0] - evl->e2->v2->co[0])*(evl->e2->v1->co[0] - evl->e2->v2->co[0])+
-                                                                               (evl->e2->v1->co[1] - evl->e2->v2->co[1])*(evl->e2->v1->co[1] - evl->e2->v2->co[1])+
-                                                                               (evl->e2->v1->co[2] - evl->e2->v2->co[2])*(evl->e2->v1->co[2] - evl->e2->v2->co[2]));
+                                                       nlen = sqrt((efa->e2->v1->co[0] - efa->e2->v2->co[0])*(efa->e2->v1->co[0] - efa->e2->v2->co[0])+
+                                                                               (efa->e2->v1->co[1] - efa->e2->v2->co[1])*(efa->e2->v1->co[1] - efa->e2->v2->co[1])+
+                                                                               (efa->e2->v1->co[2] - efa->e2->v2->co[2])*(efa->e2->v1->co[2] - efa->e2->v2->co[2]));
                                                        npct = (percentcut*slen)/nlen;
                                                        if(npct >= 1) npct = 1;
-                                                       if(evl->e2->f & 32)     npct = 1-npct;
+                                                       if(efa->e2->f & 32)     npct = 1-npct;
 
-                                                       cen[a][0]= evl->e2->v1->co[0] - ((evl->e2->v1->co[0] - evl->e2->v2->co[0]) * (npct));
-                                                       cen[a][1]= evl->e2->v1->co[1] - ((evl->e2->v1->co[1] - evl->e2->v2->co[1]) * (npct));
-                                                       cen[a][2]= evl->e2->v1->co[2] - ((evl->e2->v1->co[2] - evl->e2->v2->co[2]) * (npct));
+                                                       cen[a][0]= efa->e2->v1->co[0] - ((efa->e2->v1->co[0] - efa->e2->v2->co[0]) * (npct));
+                                                       cen[a][1]= efa->e2->v1->co[1] - ((efa->e2->v1->co[1] - efa->e2->v2->co[1]) * (npct));
+                                                       cen[a][2]= efa->e2->v1->co[2] - ((efa->e2->v1->co[2] - efa->e2->v2->co[2]) * (npct));
 
-                                                       evl->e2->f1 = 32768*(npct);                                                             
-                                                       evl->e2->v1->f |= 8;
-                                                       evl->e2->v2->f |= 8;
+                                                       efa->e2->f1 = 32768*(npct);                                                             
+                                                       efa->e2->v1->f |= 8;
+                                                       efa->e2->v2->f |= 8;
                                                        a++;
                                                }
-                                               if((evl->e3->f & 8) && a!=2){
+                                               if((efa->e3->f & 8) && a!=2){
                                                        float nlen,npct;
                                                        
-                                                       nlen = sqrt((evl->e3->v1->co[0] - evl->e3->v2->co[0])*(evl->e3->v1->co[0] - evl->e3->v2->co[0])+
-                                                                               (evl->e3->v1->co[1] - evl->e3->v2->co[1])*(evl->e3->v1->co[1] - evl->e3->v2->co[1])+
-                                                                               (evl->e3->v1->co[2] - evl->e3->v2->co[2])*(evl->e3->v1->co[2] - evl->e3->v2->co[2]));
+                                                       nlen = sqrt((efa->e3->v1->co[0] - efa->e3->v2->co[0])*(efa->e3->v1->co[0] - efa->e3->v2->co[0])+
+                                                                               (efa->e3->v1->co[1] - efa->e3->v2->co[1])*(efa->e3->v1->co[1] - efa->e3->v2->co[1])+
+                                                                               (efa->e3->v1->co[2] - efa->e3->v2->co[2])*(efa->e3->v1->co[2] - efa->e3->v2->co[2]));
                                                        npct = (percentcut*slen)/nlen;
                                                        if(npct >= 1) npct = 1;
-                                                       if(evl->e3->f & 32)     npct = 1-npct;
+                                                       if(efa->e3->f & 32)     npct = 1-npct;
 
-                                                       cen[a][0]= evl->e3->v1->co[0] - ((evl->e3->v1->co[0] - evl->e3->v2->co[0]) * (npct));
-                                                       cen[a][1]= evl->e3->v1->co[1] - ((evl->e3->v1->co[1] - evl->e3->v2->co[1]) * (npct));
-                                                       cen[a][2]= evl->e3->v1->co[2] - ((evl->e3->v1->co[2] - evl->e3->v2->co[2]) * (npct));
+                                                       cen[a][0]= efa->e3->v1->co[0] - ((efa->e3->v1->co[0] - efa->e3->v2->co[0]) * (npct));
+                                                       cen[a][1]= efa->e3->v1->co[1] - ((efa->e3->v1->co[1] - efa->e3->v2->co[1]) * (npct));
+                                                       cen[a][2]= efa->e3->v1->co[2] - ((efa->e3->v1->co[2] - efa->e3->v2->co[2]) * (npct));
 
-                                                       evl->e3->f1 = 32768*(npct);                                                             
-                                                       evl->e3->v1->f |= 8;
-                                                       evl->e3->v2->f |= 8;
+                                                       efa->e3->f1 = 32768*(npct);                                                             
+                                                       efa->e3->v1->f |= 8;
+                                                       efa->e3->v2->f |= 8;
                                                        a++;
                                                }
                                                        
-                                               if(evl->e4){
-                                                       if((evl->e4->f & 8) && a!=2){
+                                               if(efa->e4){
+                                                       if((efa->e4->f & 8) && a!=2){
                                                                float nlen,npct;
                                                                
-                                                               nlen = sqrt((evl->e4->v1->co[0] - evl->e4->v2->co[0])*(evl->e4->v1->co[0] - evl->e4->v2->co[0])+
-                                                                                       (evl->e4->v1->co[1] - evl->e4->v2->co[1])*(evl->e4->v1->co[1] - evl->e4->v2->co[1])+
-                                                                                       (evl->e4->v1->co[2] - evl->e4->v2->co[2])*(evl->e4->v1->co[2] - evl->e4->v2->co[2]));
+                                                               nlen = sqrt((efa->e4->v1->co[0] - efa->e4->v2->co[0])*(efa->e4->v1->co[0] - efa->e4->v2->co[0])+
+                                                                                       (efa->e4->v1->co[1] - efa->e4->v2->co[1])*(efa->e4->v1->co[1] - efa->e4->v2->co[1])+
+                                                                                       (efa->e4->v1->co[2] - efa->e4->v2->co[2])*(efa->e4->v1->co[2] - efa->e4->v2->co[2]));
                                                        npct = (percentcut*slen)/nlen;
                                                        if(npct >= 1) npct = 1;
-                                                       if(evl->e4->f & 32)     npct = 1-npct;
+                                                       if(efa->e4->f & 32)     npct = 1-npct;
 
-                                                               cen[a][0]= evl->e4->v1->co[0] - ((evl->e4->v1->co[0] - evl->e4->v2->co[0]) * (npct));
-                                                               cen[a][1]= evl->e4->v1->co[1] - ((evl->e4->v1->co[1] - evl->e4->v2->co[1]) * (npct));
-                                                               cen[a][2]= evl->e4->v1->co[2] - ((evl->e4->v1->co[2] - evl->e4->v2->co[2]) * (npct));
+                                                               cen[a][0]= efa->e4->v1->co[0] - ((efa->e4->v1->co[0] - efa->e4->v2->co[0]) * (npct));
+                                                               cen[a][1]= efa->e4->v1->co[1] - ((efa->e4->v1->co[1] - efa->e4->v2->co[1]) * (npct));
+                                                               cen[a][2]= efa->e4->v1->co[2] - ((efa->e4->v1->co[2] - efa->e4->v2->co[2]) * (npct));
 
-                                                               evl->e4->f1 = 32768*(npct);                                                                     
-                                                               evl->e4->v1->f |= 8;
-                                                               evl->e4->v2->f |= 8;
+                                                               efa->e4->f1 = 32768*(npct);                                                                     
+                                                               efa->e4->v1->f |= 8;
+                                                               efa->e4->v2->f |= 8;
                                                                a++;
                                                        }
                                                }
                                                else {  /* if it's a triangular face, set the remaining vertex as the cutcurve coordinate */
-                                                       if(!(evl->v1->f & 8) && evl->v1->h==0){
-                                                               cen[a][0]= evl->v1->co[0];
-                                                               cen[a][1]= evl->v1->co[1];
-                                                               cen[a][2]= evl->v1->co[2];
+                                                       if(!(efa->v1->f & 8) && efa->v1->h==0){
+                                                               cen[a][0]= efa->v1->co[0];
+                                                               cen[a][1]= efa->v1->co[1];
+                                                               cen[a][2]= efa->v1->co[2];
                                                                a++;                                                            
                                                        }
-                                                       else if(!(evl->v2->f & 8) && evl->v2->h==0){
-                                                               cen[a][0]= evl->v2->co[0];
-                                                               cen[a][1]= evl->v2->co[1];
-                                                               cen[a][2]= evl->v2->co[2];
+                                                       else if(!(efa->v2->f & 8) && efa->v2->h==0){
+                                                               cen[a][0]= efa->v2->co[0];
+                                                               cen[a][1]= efa->v2->co[1];
+                                                               cen[a][2]= efa->v2->co[2];
                                                                a++;                                                            
                                                        }
-                                                       else if(!(evl->v3->f & 8) && evl->v3->h==0){
-                                                               cen[a][0]= evl->v3->co[0];
-                                                               cen[a][1]= evl->v3->co[1];
-                                                               cen[a][2]= evl->v3->co[2];
+                                                       else if(!(efa->v3->f & 8) && efa->v3->h==0){
+                                                               cen[a][0]= efa->v3->co[0];
+                                                               cen[a][1]= efa->v3->co[1];
+                                                               cen[a][2]= efa->v3->co[2];
                                                                a++;                                                                                                    
                                                        }
                                                }
@@ -3286,8 +3284,8 @@ void loopoperations(char mode)
                eed->v2->f &= ~(2|16);          
        }
        
-       for(evl= em->faces.first; evl; evl=evl->next){
-               evl->f &= ~(4|8);
+       for(efa= em->faces.first; efa; efa=efa->next){
+               efa->f &= ~(4|8);
        }
        
        countall();
@@ -3559,7 +3557,7 @@ short extrudeflag(short flag,short type)
        EditMesh *em = G.editMesh;
        EditVert *eve, *v1, *v2, *v3, *v4, *nextve;
        EditEdge *eed, *e1, *e2, *e3, *e4, *nexted;
-       EditVlak *evl, *evl2, *nextvl;
+       EditFace *efa, *efa2, *nextvl;
        short sel=0, deloud= 0, smooth= 0;
 
        if(G.obedit==0 || get_mesh(G.obedit)==0) return 0;
@@ -3588,31 +3586,31 @@ short extrudeflag(short flag,short type)
 
        /* we set a flag in all selected faces, and increase the associated edge counters */
 
-       evl= em->faces.first;
-       while(evl) {
-               evl->f= 0;
+       efa= em->faces.first;
+       while(efa) {
+               efa->f= 0;
 
-               if (evl->flag & ME_SMOOTH) {
-                       if (vlakselectedOR(evl, 1)) smooth= 1;
+               if (efa->flag & ME_SMOOTH) {
+                       if (faceselectedOR(efa, 1)) smooth= 1;
                }
                
-               if(vlakselectedAND(evl, flag)) {
-                       e1= evl->e1;
-                       e2= evl->e2;
-                       e3= evl->e3;
-                       e4= evl->e4;
+               if(faceselectedAND(efa, flag)) {
+                       e1= efa->e1;
+                       e2= efa->e2;
+                       e3= efa->e3;
+                       e4= efa->e4;
 
                        if(e1->f < 3) e1->f++;
                        if(e2->f < 3) e2->f++;
                        if(e3->f < 3) e3->f++;
                        if(e4 && e4->f < 3) e4->f++;
-                       evl->f= 1;
+                       efa->f= 1;
                }
-               else if(vlakselectedOR(evl, flag)) {
-                       e1= evl->e1;
-                       e2= evl->e2;
-                       e3= evl->e3;
-                       e4= evl->e4;
+               else if(faceselectedOR(efa, flag)) {
+                       e1= efa->e1;
+                       e2= efa->e2;
+                       e3= efa->e3;
+                       e4= efa->e4;
                        
                        if( (e1->v1->f & flag) && (e1->v2->f & flag) ) e1->f1= 2;
                        if( (e2->v1->f & flag) && (e2->v2->f & flag) ) e2->f1= 2;
@@ -3620,31 +3618,31 @@ short extrudeflag(short flag,short type)
                        if( e4 && (e4->v1->f & flag) && (e4->v2->f & flag) ) e4->f1= 2;
                }
                
-               evl= evl->next;
+               efa= efa->next;
        }
 
        /* set direction of edges */
-       evl= em->faces.first;
-       while(evl) {
-               if(evl->f== 0) {
-                       if(evl->e1->f==2) {
-                               if(evl->e1->v1 == evl->v1) evl->e1->dir= 0;
-                               else evl->e1->dir= 1;
+       efa= em->faces.first;
+       while(efa) {
+               if(efa->f== 0) {
+                       if(efa->e1->f==2) {
+                               if(efa->e1->v1 == efa->v1) efa->e1->dir= 0;
+                               else efa->e1->dir= 1;
                        }
-                       if(evl->e2->f==2) {
-                               if(evl->e2->v1 == evl->v2) evl->e2->dir= 0;
-                               else evl->e2->dir= 1;
+                       if(efa->e2->f==2) {
+                               if(efa->e2->v1 == efa->v2) efa->e2->dir= 0;
+                               else efa->e2->dir= 1;
                        }
-                       if(evl->e3->f==2) {
-                               if(evl->e3->v1 == evl->v3) evl->e3->dir= 0;
-                               else evl->e3->dir= 1;
+                       if(efa->e3->f==2) {
+                               if(efa->e3->v1 == efa->v3) efa->e3->dir= 0;
+                               else efa->e3->dir= 1;
                        }
-                       if(evl->e4 && evl->e4->f==2) {
-                               if(evl->e4->v1 == evl->v4) evl->e4->dir= 0;
-                               else evl->e4->dir= 1;
+                       if(efa->e4 && efa->e4->f==2) {
+                               if(efa->e4->v1 == efa->v4) efa->e4->dir= 0;
+                               else efa->e4->dir= 1;
                        }
                }
-               evl= evl->next;
+               efa= efa->next;
        }       
 
 
@@ -3660,7 +3658,7 @@ short extrudeflag(short flag,short type)
                eed->f1==1: edge selected, is part of selected face, when eed->f==3: remove
                eed->f1==2: edge selected, is not part of a selected face
                                        
-               evl->f==1 : duplicate this face
+               efa->f==1 : duplicate this face
        */
 
        /* copy all selected vertices, */
@@ -3695,18 +3693,18 @@ short extrudeflag(short flag,short type)
                if( (eed->f==1 || eed->f==2) ) {
                        if(eed->f1==2) deloud=1;
                        
-                       if(eed->dir==1) evl2= addvlaklist(eed->v1, eed->v2, eed->v2->vn, eed->v1->vn, NULL);
-                       else evl2= addvlaklist(eed->v2, eed->v1, eed->v1->vn, eed->v2->vn, NULL);
-                       if (smooth) evl2->flag |= ME_SMOOTH;
+                       if(eed->dir==1) efa2= addfacelist(eed->v1, eed->v2, eed->v2->vn, eed->v1->vn, NULL);
+                       else efa2= addfacelist(eed->v2, eed->v1, eed->v1->vn, eed->v2->vn, NULL);
+                       if (smooth) efa2->flag |= ME_SMOOTH;
 
                        /* Needs smarter adaption of existing creases.
                         * If addedgelist is used, make sure seams are set to 0 on these
                         * new edges, since we do not want to add any seams on extrusion.
                         */
-                       evl2->e1->crease= eed->crease;
-                       evl2->e2->crease= eed->crease;
-                       evl2->e3->crease= eed->crease;
-                       if(evl2->e4) evl2->e4->crease= eed->crease;
+                       efa2->e1->crease= eed->crease;
+                       efa2->e2->crease= eed->crease;
+                       efa2->e3->crease= eed->crease;
+                       if(efa2->e4) efa2->e4->crease= eed->crease;
                }
 
                eed= nexted;
@@ -3723,25 +3721,25 @@ short extrudeflag(short flag,short type)
                }
        }
        /* duplicate faces, if necessart remove old ones  */
-       evl= em->faces.first;
-       while(evl) {
-               nextvl= evl->next;
-               if(evl->f & 1) {
-               
-                       v1= evl->v1->vn;
-                       v2= evl->v2->vn;
-                       v3= evl->v3->vn;
-                       if(evl->v4) v4= evl->v4->vn; else v4= 0;
+       efa= em->faces.first;
+       while(efa) {
+               nextvl= efa->next;
+               if(efa->f & 1) {
+               
+                       v1= efa->v1->vn;
+                       v2= efa->v2->vn;
+                       v3= efa->v3->vn;
+                       if(efa->v4) v4= efa->v4->vn; else v4= 0;
                        
-                       evl2= addvlaklist(v1, v2, v3, v4, evl);
+                       efa2= addfacelist(v1, v2, v3, v4, efa);
                        
                        if(deloud) {
-                               BLI_remlink(&em->faces, evl);
-                               free_editvlak(evl);
+                               BLI_remlink(&em->faces, efa);
+                               free_editface(efa);
                        }
-                       if (smooth) evl2->flag |= ME_SMOOTH;                    
+                       if (smooth) efa2->flag |= ME_SMOOTH;                    
                }
-               evl= nextvl;
+               efa= nextvl;
        }
        /* for all vertices with eve->vn!=0 
                if eve->f1==1: make edge
@@ -3812,9 +3810,9 @@ short removedoublesflag(short flag, float limit)          /* return amount */
        /* all verts with (flag & 'flag') are being evaluated */
        EditVert *eve, *v1, *nextve;
        EditEdge *eed, *e1, *nexted;
-       EditVlak *evl, *nextvl;
+       EditFace *efa, *nextvl;
        struct xvertsort *sortblock, *sb, *sb1;
-       struct vlaksort *vlsortblock, *vsb, *vsb1;
+       struct facesort *vlsortblock, *vsb, *vsb1;
        float dist;
        int a, b, test, aantal;
 
@@ -3901,114 +3899,114 @@ short removedoublesflag(short flag, float limit)              /* return amount */
        }
 
        /* first count amount of test faces */
-       evl= (struct EditVlak *)em->faces.first;
+       efa= (struct EditFace *)em->faces.first;
        aantal= 0;
-       while(evl) {
-               evl->f= 0;
-               if(evl->v1->f & 128) evl->f= 1;
-               else if(evl->v2->f & 128) evl->f= 1;
-               else if(evl->v3->f & 128) evl->f= 1;
-               else if(evl->v4 && (evl->v4->f & 128)) evl->f= 1;
+       while(efa) {
+               efa->f= 0;
+               if(efa->v1->f & 128) efa->f= 1;
+               else if(efa->v2->f & 128) efa->f= 1;
+               else if(efa->v3->f & 128) efa->f= 1;
+               else if(efa->v4 && (efa->v4->f & 128)) efa->f= 1;
                
-               if(evl->f==1) aantal++;
-               evl= evl->next;
+               if(efa->f==1) aantal++;
+               efa= efa->next;
        }
 
        /* test faces for double vertices, and if needed remove them */
-       evl= (struct EditVlak *)em->faces.first;
-       while(evl) {
-               nextvl= evl->next;
-               if(evl->f==1) {
+       efa= (struct EditFace *)em->faces.first;
+       while(efa) {
+               nextvl= efa->next;
+               if(efa->f==1) {
                        
-                       if(evl->v1->f & 128) evl->v1= evl->v1->vn;
-                       if(evl->v2->f & 128) evl->v2= evl->v2->vn;
-                       if(evl->v3->f & 128) evl->v3= evl->v3->vn;
-                       if(evl->v4 && (evl->v4->f & 128)) evl->v4= evl->v4->vn;
+                       if(efa->v1->f & 128) efa->v1= efa->v1->vn;
+                       if(efa->v2->f & 128) efa->v2= efa->v2->vn;
+                       if(efa->v3->f & 128) efa->v3= efa->v3->vn;
+                       if(efa->v4 && (efa->v4->f & 128)) efa->v4= efa->v4->vn;
                
                        test= 0;
-                       if(evl->v1==evl->v2) test+=1;
-                       if(evl->v2==evl->v3) test+=2;
-                       if(evl->v3==evl->v1) test+=4;
-                       if(evl->v4==evl->v1) test+=8;
-                       if(evl->v3==evl->v4) test+=16;
-                       if(evl->v2==evl->v4) test+=32;
+                       if(efa->v1==efa->v2) test+=1;
+                       if(efa->v2==efa->v3) test+=2;
+                       if(efa->v3==efa->v1) test+=4;
+                       if(efa->v4==efa->v1) test+=8;
+                       if(efa->v3==efa->v4) test+=16;
+                       if(efa->v2==efa->v4) test+=32;
                        
                        if(test) {
-                               if(evl->v4) {
+                               if(efa->v4) {
                                        if(test==1 || test==2) {
-                                               evl->v2= evl->v3;
-                                               evl->v3= evl->v4;
-                                               evl->v4= 0;
+                                               efa->v2= efa->v3;
+                                               efa->v3= efa->v4;
+                                               efa->v4= 0;
                                                test= 0;
                                        }
                                        else if(test==8 || test==16) {
-                                               evl->v4= 0;
+                                               efa->v4= 0;
                                                test= 0;
                                        }
                                        else {
-                                               BLI_remlink(&em->faces, evl);
-                                               free_editvlak(evl);
+                                               BLI_remlink(&em->faces, efa);
+                                               free_editface(efa);
                                                aantal--;
                                        }
                                }
                                else {
-                                       BLI_remlink(&em->faces, evl);
-                                       free_editvlak(evl);
+                                       BLI_remlink(&em->faces, efa);
+                                       free_editface(efa);
                                        aantal--;
                                }
                        }
                        
                        if(test==0) {
                                /* set edge pointers */
-                               evl->e1= findedgelist(evl->v1, evl->v2);
-                               evl->e2= findedgelist(evl->v2, evl->v3);
-                               if(evl->v4==0) {
-                                       evl->e3= findedgelist(evl->v3, evl->v1);
-                                       evl->e4= 0;
+                               efa->e1= findedgelist(efa->v1, efa->v2);
+                               efa->e2= findedgelist(efa->v2, efa->v3);
+                               if(efa->v4==0) {
+                                       efa->e3= findedgelist(efa->v3, efa->v1);
+                                       efa->e4= 0;
                                }
                                else {
-                                       evl->e3= findedgelist(evl->v3, evl->v4);
-                                       evl->e4= findedgelist(evl->v4, evl->v1);
+                                       efa->e3= findedgelist(efa->v3, efa->v4);
+                                       efa->e4= findedgelist(efa->v4, efa->v1);
                                }
                        }
                }
-               evl= nextvl;
+               efa= nextvl;
        }
 
        /* double faces: sort block */
        /* count again, now all selected faces */
        aantal= 0;
-       evl= em->faces.first;
-       while(evl) {
-               evl->f= 0;
-               if(vlakselectedAND(evl, 1)) {
-                       evl->f= 1;
+       efa= em->faces.first;
+       while(efa) {
+               efa->f= 0;
+               if(faceselectedAND(efa, 1)) {
+                       efa->f= 1;
                        aantal++;
                }
-               evl= evl->next;
+               efa= efa->next;
        }
 
        if(aantal) {
                /* double faces: sort block */
-               vsb= vlsortblock= MEM_mallocN(sizeof(struct vlaksort)*aantal, "sortremovedoub");
-               evl= em->faces.first;
-               while(evl) {
-                       if(evl->f & 1) {
-                               if(evl->v4) vsb->x= (long) MIN4( (long)evl->v1, (long)evl->v2, (long)evl->v3, (long)evl->v4);
-                               else vsb->x= (long) MIN3( (long)evl->v1, (long)evl->v2, (long)evl->v3);
-
-                               vsb->evl= evl;
+               vsb= vlsortblock= MEM_mallocN(sizeof(struct facesort)*aantal, "sortremovedoub");
+               efa= em->faces.first;
+               while(efa) {
+                       if(efa->f & 1) {
+                               if(efa->v4) vsb->x= (long) MIN4( (long)efa->v1, (long)efa->v2, (long)efa->v3, (long)efa->v4);
+                               else vsb->x= (long) MIN3( (long)efa->v1, (long)efa->v2, (long)efa->v3);
+
+                               vsb->efa= efa;
                                vsb++;
                        }
-                       evl= evl->next;
+                       efa= efa->next;
                }
                
-               qsort(vlsortblock, aantal, sizeof(struct vlaksort), vergvlak);
+               qsort(vlsortblock, aantal, sizeof(struct facesort), vergface);
                        
                vsb= vlsortblock;
                for(a=0; a<aantal; a++) {
-                       evl= vsb->evl;
-                       if( (evl->f & 128)==0 ) {
+                       efa= vsb->efa;
+                       if( (efa->f & 128)==0 ) {
                                vsb1= vsb+1;
 
                                for(b=a+1; b<aantal; b++) {
@@ -4017,9 +4015,9 @@ short removedoublesflag(short flag, float limit)          /* return amount */
                                        if(vsb->x != vsb1->x) break;
                                        
                                        /* second test: is test permitted? */
-                                       evl= vsb1->evl;
-                                       if( (evl->f & 128)==0 ) {
-                                               if( comparevlak(evl, vsb->evl)) evl->f |= 128;
+                                       efa= vsb1->efa;
+                                       if( (efa->f & 128)==0 ) {
+                                               if( compareface(efa, vsb->efa)) efa->f |= 128;
                                                
                                        }
                                        vsb1++;
@@ -4031,14 +4029,14 @@ short removedoublesflag(short flag, float limit)                /* return amount */
                MEM_freeN(vlsortblock);
                
                /* remove double faces */
-               evl= (struct EditVlak *)em->faces.first;
-               while(evl) {
-                       nextvl= evl->next;
-                       if(evl->f & 128) {
-                               BLI_remlink(&em->faces, evl);
-                               free_editvlak(evl);
+               efa= (struct EditFace *)em->faces.first;
+               while(efa) {
+                       nextvl= efa->next;
+                       if(efa->f & 128) {
+                               BLI_remlink(&em->faces, efa);
+                               free_editface(efa);
                        }
-                       evl= nextvl;
+                       efa= nextvl;
                }
        }
        
@@ -4201,15 +4199,15 @@ static void uv_quart(float *uv, float *uv1)
        uv[1]= (uv1[1]+uv1[3]+uv1[5]+uv1[7])/4.0;
 }
 
-static void vlak_pin_vertex(EditVlak *evl, EditVert *vertex)
+static void face_pin_vertex(EditFace *efa, EditVert *vertex)
 {
-       if(evl->v1 == vertex) evl->tf.unwrap |= TF_PIN1;
-       else if(evl->v2 == vertex) evl->tf.unwrap |= TF_PIN2;
-       else if(evl->v3 == vertex) evl->tf.unwrap |= TF_PIN3;
-       else if(evl->v4 && vertex && evl->v4 == vertex) evl->tf.unwrap |= TF_PIN4;
+       if(efa->v1 == vertex) efa->tf.unwrap |= TF_PIN1;
+       else if(efa->v2 == vertex) efa->tf.unwrap |= TF_PIN2;
+       else if(efa->v3 == vertex) efa->tf.unwrap |= TF_PIN3;
+       else if(efa->v4 && vertex && efa->v4 == vertex) efa->tf.unwrap |= TF_PIN4;
 }
 
-static void set_wuv(int tot, EditVlak *evl, int v1, int v2, int v3, int v4, EditVlak *evlpin)
+static void set_wuv(int tot, EditFace *efa, int v1, int v2, int v3, int v4, EditFace *efapin)
 {
        /* this weird function only to be used for subdivide, the 'w' in the name has no meaning! */
        float *uv, uvo[4][2];
@@ -4217,21 +4215,21 @@ static void set_wuv(int tot, EditVlak *evl, int v1, int v2, int v3, int v4, Edit
        int a, v;
 
        /* recover pinning */
-       if(evlpin){
-               evl->tf.unwrap= 0;
-               if(evlpin->tf.unwrap & TF_PIN1) vlak_pin_vertex(evl, evlpin->v1);
-               if(evlpin->tf.unwrap & TF_PIN2) vlak_pin_vertex(evl, evlpin->v2);
-               if(evlpin->tf.unwrap & TF_PIN3) vlak_pin_vertex(evl, evlpin->v3);
-               if(evlpin->tf.unwrap & TF_PIN4) vlak_pin_vertex(evl, evlpin->v4);
+       if(efapin){
+               efa->tf.unwrap= 0;
+               if(efapin->tf.unwrap & TF_PIN1) face_pin_vertex(efa, efapin->v1);
+               if(efapin->tf.unwrap & TF_PIN2) face_pin_vertex(efa, efapin->v2);
+               if(efapin->tf.unwrap & TF_PIN3) face_pin_vertex(efa, efapin->v3);
+               if(efapin->tf.unwrap & TF_PIN4) face_pin_vertex(efa, efapin->v4);
        }
 
                                                /* Numbers corespond to verts (corner points),  */
                                                /* edge->vn's (center edges), the Center        */
-       memcpy(uvo, evl->tf.uv, sizeof(uvo));   /* And the quincunx points of a face            */
-       uv= evl->tf.uv[0];                            /* as shown here:                                 */
+       memcpy(uvo, efa->tf.uv, sizeof(uvo));   /* And the quincunx points of a face            */
+       uv= efa->tf.uv[0];                            /* as shown here:                                 */
                                                      /*           2         5          1   */
-       memcpy(colo, evl->tf.col, sizeof(colo));      /*               10         13        */
-       col= evl->tf.col;                             /*           6         9          8   */
+       memcpy(colo, efa->tf.col, sizeof(colo));      /*               10         13        */
+       col= efa->tf.col;                             /*           6         9          8   */
                                                   /*               11         12        */
        if(tot==4) {                                  /*           3         7          4   */
                for(a=0; a<4; a++, uv+=2, col++) {
@@ -4317,53 +4315,53 @@ static void set_wuv(int tot, EditVlak *evl, int v1, int v2, int v3, int v4, Edit
        }
 }
 
-static EditVert *vert_from_number(EditVlak *evl, int nr)
+static EditVert *vert_from_number(EditFace *efa, int nr)
 {
        switch(nr) {
        case 0:
                return 0;
        case 1:
-               return evl->v1;
+               return efa->v1;
        case 2:
-               return evl->v2;
+               return efa->v2;
        case 3:
-               return evl->v3;
+               return efa->v3;
        case 4:
-               return evl->v4;
+               return efa->v4;
        case 5:
-               return evl->e1->vn;
+               return efa->e1->vn;
        case 6:
-               return evl->e2->vn;
+               return efa->e2->vn;
        case 7:
-               return evl->e3->vn;
+               return efa->e3->vn;
        case 8:
-               return evl->e4->vn;
+               return efa->e4->vn;
        }
        
        return NULL;
 }
 
-static void addvlak_subdiv(EditVlak *evl, int val1, int val2, int val3, int val4, EditVert *eve, EditVlak *evlpin)
+static void addface_subdiv(EditFace *efa, int val1, int val2, int val3, int val4, EditVert *eve, EditFace *efapin)
 {
-       EditVlak *w;
+       EditFace *w;
        EditVert *v1, *v2, *v3, *v4;
        
        if(val1>=9) v1= eve;
-       else v1= vert_from_number(evl, val1);
+       else v1= vert_from_number(efa, val1);
        
        if(val2>=9) v2= eve;
-       else v2= vert_from_number(evl, val2);
+       else v2= vert_from_number(efa, val2);
 
        if(val3>=9) v3= eve;
-       else v3= vert_from_number(evl, val3);
+       else v3= vert_from_number(efa, val3);
 
        if(val4>=9) v4= eve;
-       else v4= vert_from_number(evl, val4);
+       else v4= vert_from_number(efa, val4);
        
-       w= addvlaklist(v1, v2, v3, v4, evl);
+       w= addfacelist(v1, v2, v3, v4, efa);
        if(w) {
-               if(evl->v4) set_wuv(4, w, val1, val2, val3, val4, evlpin);
-               else set_wuv(3, w, val1, val2, val3, val4, evlpin);
+               if(efa->v4) set_wuv(4, w, val1, val2, val3, val4, efapin);
+               else set_wuv(3, w, val1, val2, val3, val4, efapin);
        }
 }
 
@@ -4398,7 +4396,7 @@ static void smooth_subdiv_vec(float *v1, float *v2, float *n1, float *n2, float
        vec[2]*= smoothperc*len;
 }
 
-static void smooth_subdiv_quad(EditVlak *evl, float *vec)
+static void smooth_subdiv_quad(EditFace *efa, float *vec)
 {
        
        float nor1[3], nor2[3];
@@ -4407,23 +4405,23 @@ static void smooth_subdiv_quad(EditVlak *evl, float *vec)
        
        /* vlr->e1->vn is new vertex inbetween v1 / v2 */
        
-       VecMidf(nor1, evl->v1->no, evl->v2->no);
+       VecMidf(nor1, efa->v1->no, efa->v2->no);
        Normalise(nor1);
-       VecMidf(nor2, evl->v3->no, evl->v4->no);
+       VecMidf(nor2, efa->v3->no, efa->v4->no);
        Normalise(nor2);
 
-       smooth_subdiv_vec( evl->e1->vn->co, evl->e3->vn->co, nor1, nor2, vec1);
+       smooth_subdiv_vec( efa->e1->vn->co, efa->e3->vn->co, nor1, nor2, vec1);
 
-       VecMidf(nor1, evl->v2->no, evl->v3->no);
+       VecMidf(nor1, efa->v2->no, efa->v3->no);
        Normalise(nor1);
-       VecMidf(nor2, evl->v4->no, evl->v1->no);
+       VecMidf(nor2, efa->v4->no, efa->v1->no);
        Normalise(nor2);
 
-       smooth_subdiv_vec( evl->e2->vn->co, evl->e4->vn->co, nor1, nor2, vec2);
+       smooth_subdiv_vec( efa->e2->vn->co, efa->e4->vn->co, nor1, nor2, vec2);
 
        VecAddf(vec1, vec1, vec2);
 
-       CalcCent4f(cent, evl->v1->co,  evl->v2->co,  evl->v3->co,  evl->v4->co);
+       CalcCent4f(cent, efa->v1->co,  efa->v2->co,  efa->v3->co,  efa->v4->co);
        VecAddf(vec, cent, vec1);
 }
 
@@ -4436,7 +4434,7 @@ void subdivideflag(int flag, float rad, int beauty)
        extern float doublimit;
        EditVert *eve;
        EditEdge *eed, *e1, *e2, *e3, *e4, *nexted;
-       EditVlak *evl, evlpin;
+       EditFace *efa, efapin;
        float fac, vec[3], vec1[3], len1, len2, len3, percent;
        short test;
        
@@ -4458,59 +4456,59 @@ void subdivideflag(int flag, float rad, int beauty)
        
        /* if beauty: test for area and clear edge flags of 'ugly' edges */
        if(beauty & B_BEAUTY) {
-               evl= em->faces.first;
-               while(evl) {
-                       if( vlakselectedAND(evl, flag) ) {
-                               if(evl->v4) {
+               efa= em->faces.first;
+               while(efa) {
+                       if( faceselectedAND(efa, flag) ) {
+                               if(efa->v4) {
                                
                                        /* area */
-                                       len1= AreaQ3Dfl(evl->v1->co, evl->v2->co, evl->v3->co, evl->v4->co);
+                                       len1= AreaQ3Dfl(efa->v1->co, efa->v2->co, efa->v3->co, efa->v4->co);
                                        if(len1 <= doublimit) {
-                                               evl->e1->f = 0;
-                                               evl->e2->f = 0;
-                                               evl->e3->f = 0;
-                                               evl->e4->f = 0;
+                                               efa->e1->f = 0;
+                                               efa->e2->f = 0;
+                                               efa->e3->f = 0;
+                                               efa->e4->f = 0;
                                        }
                                        else {
-                                               len1= VecLenf(evl->v1->co, evl->v2->co) + VecLenf(evl->v3->co, evl->v4->co);
-                                               len2= VecLenf(evl->v2->co, evl->v3->co) + VecLenf(evl->v1->co, evl->v4->co);
+                                               len1= VecLenf(efa->v1->co, efa->v2->co) + VecLenf(efa->v3->co, efa->v4->co);
+                                               len2= VecLenf(efa->v2->co, efa->v3->co) + VecLenf(efa->v1->co, efa->v4->co);
                                                
                                                if(len1 < len2) {
-                                                       evl->e1->f = 0;
-                                                       evl->e3->f = 0;
+                                                       efa->e1->f = 0;
+                                                       efa->e3->f = 0;
                                                }
                                                else if(len1 > len2) {
-                                                       evl->e2->f = 0;
-                                                       evl->e4->f = 0;
+                                                       efa->e2->f = 0;
+                                                       efa->e4->f = 0;
                                                }
                                        }
                                }
                                else {
                                        /* area */
-                                       len1= AreaT3Dfl(evl->v1->co, evl->v2->co, evl->v3->co);
+                                       len1= AreaT3Dfl(efa->v1->co, efa->v2->co, efa->v3->co);
                                        if(len1 <= doublimit) {
-                                               evl->e1->f = 0;
-                                               evl->e2->f = 0;
-                                               evl->e3->f = 0;
+                                               efa->e1->f = 0;
+                                               efa->e2->f = 0;
+                                               efa->e3->f = 0;
                                        }
                                        else {
-                                               len1= VecLenf(evl->v1->co, evl->v2->co) ;
-                                               len2= VecLenf(evl->v2->co, evl->v3->co) ;
-                                               len3= VecLenf(evl->v3->co, evl->v1->co) ;
+                                               len1= VecLenf(efa->v1->co, efa->v2->co) ;
+                                               len2= VecLenf(efa->v2->co, efa->v3->co) ;
+                                               len3= VecLenf(efa->v3->co, efa->v1->co) ;
                                                
                                                if(len1<len2 && len1<len3) {
-                                                       evl->e1->f = 0;
+                                                       efa->e1->f = 0;
                                                }
                                                else if(len2<len3 && len2<len1) {
-                                                       evl->e2->f = 0;
+                                                       efa->e2->f = 0;
                                                }
                                                else if(len3<len2 && len3<len1) {
-                                                       evl->e3->f = 0;
+                                                       efa->e3->f = 0;
                                                }
                                        }
                                }
                        }
-                       evl= evl->next;
+                       efa= efa->next;
                }
        }
 
@@ -4564,16 +4562,16 @@ void subdivideflag(int flag, float rad, int beauty)
 
        /* test all faces for subdivide edges, there are 8 or 16 cases (ugh)! */
 
-       evl= em->faces.last;
-       while(evl) {
+       efa= em->faces.last;
+       while(efa) {
 
-               evlpin= *evl; /* make a copy of evl to recover uv pinning later */
+               efapin= *efa; /* make a copy of efa to recover uv pinning later */
 
-               if( vlakselectedOR(evl, flag) ) {
-                       e1= evl->e1;
-                       e2= evl->e2;
-                       e3= evl->e3;
-                       e4= evl->e4;
+               if( faceselectedOR(efa, flag) ) {
+                       e1= efa->e1;
+                       e2= efa->e2;
+                       e3= efa->e3;
+                       e4= efa->e4;
 
                        test= 0;
                        if(e1 && e1->vn) { 
@@ -4605,111 +4603,111 @@ void subdivideflag(int flag, float rad, int beauty)
                                eed= addedgelist(e4->vn, e4->v2, e4);
                        }
                        if(test) {
-                               if(evl->v4==0) {  /* All the permutations of 3 edges*/
-                                       if((test & 3)==3) addvlak_subdiv(evl, 2, 2+4, 1+4, 0, 0, &evlpin);
-                                       if((test & 6)==6) addvlak_subdiv(evl, 3, 3+4, 2+4, 0, 0, &evlpin);
-                                       if((test & 5)==5) addvlak_subdiv(evl, 1, 1+4, 3+4, 0, 0, &evlpin);
+                               if(efa->v4==0) {  /* All the permutations of 3 edges*/
+                                       if((test & 3)==3) addface_subdiv(efa, 2, 2+4, 1+4, 0, 0, &efapin);
+                                       if((test & 6)==6) addface_subdiv(efa, 3, 3+4, 2+4, 0, 0, &efapin);
+                                       if((test & 5)==5) addface_subdiv(efa, 1, 1+4, 3+4, 0, 0, &efapin);
 
                                        if(test==7) {  /* four new faces, old face renews */
-                                               evl->v1= e1->vn;
-                                               evl->v2= e2->vn;
-                                               evl->v3= e3->vn;
-                                               set_wuv(3, evl, 1+4, 2+4, 3+4, 0, &evlpin);
+                                               efa->v1= e1->vn;
+                                               efa->v2= e2->vn;
+                                               efa->v3= e3->vn;
+                                               set_wuv(3, efa, 1+4, 2+4, 3+4, 0, &efapin);
                                        }
                                        else if(test==3) {
-                                               addvlak_subdiv(evl, 1+4, 2+4, 3, 0, 0, &evlpin);
-                                               evl->v2= e1->vn;
-                                               set_wuv(3, evl, 1, 1+4, 3, 0, &evlpin);
+                                               addface_subdiv(efa, 1+4, 2+4, 3, 0, 0, &efapin);
+                                               efa->v2= e1->vn;
+                                               set_wuv(3, efa, 1, 1+4, 3, 0, &efapin);
                                        }
                                        else if(test==6) {
-                                               addvlak_subdiv(evl, 2+4, 3+4, 1, 0, 0, &evlpin);
-                                               evl->v3= e2->vn;
-                                               set_wuv(3, evl, 1, 2, 2+4, 0, &evlpin);
+                                               addface_subdiv(efa, 2+4, 3+4, 1, 0, 0, &efapin);
+                                               efa->v3= e2->vn;
+                                               set_wuv(3, efa, 1, 2, 2+4, 0, &efapin);
                                        }
                                        else if(test==5) {
-                                               addvlak_subdiv(evl, 3+4, 1+4, 2, 0, 0, &evlpin);
-                                               evl->v1= e3->vn;
-                                               set_wuv(3, evl, 3+4, 2, 3, 0, &evlpin);
+                                               addface_subdiv(efa, 3+4, 1+4, 2, 0, 0, &efapin);
+                                               efa->v1= e3->vn;
+                                               set_wuv(3, efa, 3+4, 2, 3, 0, &efapin);
                                        }
                                        else if(test==1) {
-                                               addvlak_subdiv(evl, 1+4, 2, 3, 0, 0, &evlpin);
-                                               evl->v2= e1->vn;
-                                               set_wuv(3, evl, 1, 1+4, 3, 0, &evlpin);
+                                               addface_subdiv(efa, 1+4, 2, 3, 0, 0, &efapin);
+                                               efa->v2= e1->vn;
+                                               set_wuv(3, efa, 1, 1+4, 3, 0, &efapin);
                                        }
                                        else if(test==2) {
-                                               addvlak_subdiv(evl, 2+4, 3, 1, 0, 0, &evlpin);
-                                               evl->v3= e2->vn;
-                                               set_wuv(3, evl, 1, 2, 2+4, 0, &evlpin);
+                                               addface_subdiv(efa, 2+4, 3, 1, 0, 0, &efapin);
+                                               efa->v3= e2->vn;
+                                               set_wuv(3, efa, 1, 2, 2+4, 0, &efapin);
                                        }
                                        else if(test==4) {
-                                               addvlak_subdiv(evl, 3+4, 1, 2, 0, 0, &evlpin);
-                                               evl->v1= e3->vn;
-                                               set_wuv(3, evl, 3+4, 2, 3, 0, &evlpin);
+                                               addface_subdiv(efa, 3+4, 1, 2, 0, 0, &efapin);
+                                               efa->v1= e3->vn;
+                                               set_wuv(3, efa, 3+4, 2, 3, 0, &efapin);
                                        }
-                                       evl->e1= addedgelist(evl->v1, evl->v2, NULL);
-                                       evl->e2= addedgelist(evl->v2, evl->v3, NULL);
-                                       evl->e3= addedgelist(evl->v3, evl->v1, NULL);
+                                       efa->e1= addedgelist(efa->v1, efa->v2, NULL);
+                                       efa->e2= addedgelist(efa->v2, efa->v3, NULL);
+                                       efa->e3= addedgelist(efa->v3, efa->v1, NULL);
 
                                }
                                else {  /* All the permutations of 4 faces */
                                        if(test==15) {
                                                /* add a new point in center */
-                                               CalcCent4f(vec, evl->v1->co, evl->v2->co, evl->v3->co, evl->v4->co);
+                                               CalcCent4f(vec, efa->v1->co, efa->v2->co, efa->v3->co, efa->v4->co);
                                                
                                                if(beauty & B_SMOOTH) {
-                                                       smooth_subdiv_quad(evl, vec);   /* adds */
+                                                       smooth_subdiv_quad(efa, vec);   /* adds */
                                                }
                                                eve= addvertlist(vec);
                                                
                                                eve->f |= flag;
 
-                                               addvlak_subdiv(evl, 2, 2+4, 9, 1+4, eve, &evlpin);
-                                               addvlak_subdiv(evl, 3, 3+4, 9, 2+4, eve, &evlpin);
-                                               addvlak_subdiv(evl, 4, 4+4, 9, 3+4, eve, &evlpin);
+                                               addface_subdiv(efa, 2, 2+4, 9, 1+4, eve, &efapin);
+                                               addface_subdiv(efa, 3, 3+4, 9, 2+4, eve, &efapin);
+                                               addface_subdiv(efa, 4, 4+4, 9, 3+4, eve, &efapin);
 
-                                               evl->v2= e1->vn;
-                                               evl->v3= eve;
-                                               evl->v4= e4->vn;
-                                               set_wuv(4, evl, 1, 1+4, 9, 4+4, &evlpin);
+                                               efa->v2= e1->vn;
+                                               efa->v3= eve;
+                                               efa->v4= e4->vn;
+                                               set_wuv(4, efa, 1, 1+4, 9, 4+4, &efapin);
                                        }
                                        else {
-                                               if(((test & 3)==3)&&(test!=3)) addvlak_subdiv(evl, 1+4, 2, 2+4, 0, 0, &evlpin);
-                                               if(((test & 6)==6)&&(test!=6)) addvlak_subdiv(evl, 2+4, 3, 3+4, 0, 0, &evlpin);
-                                               if(((test & 12)==12)&&(test!=12)) addvlak_subdiv(evl, 3+4, 4, 4+4, 0, 0, &evlpin);
-                                               if(((test & 9)==9)&&(test!=9)) addvlak_subdiv(evl, 4+4, 1, 1+4, 0, 0, &evlpin);
+                                               if(((test & 3)==3)&&(test!=3)) addface_subdiv(efa, 1+4, 2, 2+4, 0, 0, &efapin);
+                                               if(((test & 6)==6)&&(test!=6)) addface_subdiv(efa, 2+4, 3, 3+4, 0, 0, &efapin);
+                                               if(((test & 12)==12)&&(test!=12)) addface_subdiv(efa, 3+4, 4, 4+4, 0, 0, &efapin);
+                                               if(((test & 9)==9)&&(test!=9)) addface_subdiv(efa, 4+4, 1, 1+4, 0, 0, &efapin);
 
                                                if(test==1) { /* Edge 1 has new vert */
-                                                       addvlak_subdiv(evl, 1+4, 2, 3, 0, 0, &evlpin);
-                                                       addvlak_subdiv(evl, 1+4, 3, 4, 0, 0, &evlpin);
-                                                       evl->v2= e1->vn;
-                                                       evl->v3= evl->v4;
-                                                       evl->v4= 0;
-                                                       set_wuv(4, evl, 1, 1+4, 4, 0, &evlpin);
+                                                       addface_subdiv(efa, 1+4, 2, 3, 0, 0, &efapin);
+                                                       addface_subdiv(efa, 1+4, 3, 4, 0, 0, &efapin);
+                                                       efa->v2= e1->vn;
+                                                       efa->v3= efa->v4;
+                                                       efa->v4= 0;
+                                                       set_wuv(4, efa, 1, 1+4, 4, 0, &efapin);
                                                }
                                                else if(test==2) { /* Edge 2 has new vert */
-                                                       addvlak_subdiv(evl, 2+4, 3, 4, 0, 0, &evlpin);
-                                                       addvlak_subdiv(evl, 2+4, 4, 1, 0, 0, &evlpin);
-                                                       evl->v3= e2->vn;
-                                                       evl->v4= 0;
-                                                       set_wuv(4, evl, 1, 2, 2+4, 0, &evlpin);
+                                                       addface_subdiv(efa, 2+4, 3, 4, 0, 0, &efapin);
+                                                       addface_subdiv(efa, 2+4, 4, 1, 0, 0, &efapin);
+                                                       efa->v3= e2->vn;
+                                                       efa->v4= 0;
+                                                       set_wuv(4, efa, 1, 2, 2+4, 0, &efapin);
                                                }
                                                else if(test==4) { /* Edge 3 has new vert */
-                                                       addvlak_subdiv(evl, 3+4, 4, 1, 0, 0, &evlpin);
-                                                       addvlak_subdiv(evl, 3+4, 1, 2, 0, 0, &evlpin);
-                                                       evl->v1= evl->v2;
-                                                       evl->v2= evl->v3;
-                                                       evl->v3= e3->vn;
-                                                       evl->v4= 0;
-                                                       set_wuv(4, evl, 2, 3, 3+4, 0, &evlpin);
+                                                       addface_subdiv(efa, 3+4, 4, 1, 0, 0, &efapin);
+                                                       addface_subdiv(efa, 3+4, 1, 2, 0, 0, &efapin);
+                                                       efa->v1= efa->v2;
+                                                       efa->v2= efa->v3;
+                                                       efa->v3= e3->vn;
+                                                       efa->v4= 0;
+                                                       set_wuv(4, efa, 2, 3, 3+4, 0, &efapin);
                                                }
                                                else if(test==8) { /* Edge 4 has new vert */
-                                                       addvlak_subdiv(evl, 4+4, 1, 2, 0, 0, &evlpin);
-                                                       addvlak_subdiv(evl, 4+4, 2, 3, 0, 0, &evlpin);
-                                                       evl->v1= evl->v3;
-                                                       evl->v2= evl->v4;
-                                                       evl->v3= e4->vn;
-                                                       evl->v4= 0;
-                                                       set_wuv(4, evl, 3, 4, 4+4, 0, &evlpin);
+                                                       addface_subdiv(efa, 4+4, 1, 2, 0, 0, &efapin);
+                                                       addface_subdiv(efa, 4+4, 2, 3, 0, 0, &efapin);
+                                                       efa->v1= efa->v3;
+                                                       efa->v2= efa->v4;
+                                                       efa->v3= e4->vn;
+                                                       efa->v4= 0;
+                                                       set_wuv(4, efa, 3, 4, 4+4, 0, &efapin);
                                                }
                                                else if(test==3) { /*edge 1&2 */
                                                        /* make new vert in center of new edge */
@@ -4719,15 +4717,15 @@ void subdivideflag(int flag, float rad, int beauty)
                                                        eve= addvertlist(vec);
                                                        eve->f |= flag;
                                                        /* Add new faces */
-                                                       addvlak_subdiv(evl, 4, 10, 2+4, 3, eve, &evlpin);
-                                                       addvlak_subdiv(evl, 4, 1, 1+4, 10, eve, &evlpin);
+                                                       addface_subdiv(efa, 4, 10, 2+4, 3, eve, &efapin);
+                                                       addface_subdiv(efa, 4, 1, 1+4, 10, eve, &efapin);
                                                        /* orig face becomes small corner */
-                                                       evl->v1=e1->vn;
-                                                       //evl->v2=evl->v2;
-                                                       evl->v3=e2->vn;
-                                                       evl->v4=eve;
+                                                       efa->v1=e1->vn;
+                                                       //efa->v2=efa->v2;
+                                                       efa->v3=e2->vn;
+                                                       efa->v4=eve;
 
-                                                       set_wuv(4, evl, 1+4, 2, 2+4, 10, &evlpin);
+                                                       set_wuv(4, efa, 1+4, 2, 2+4, 10, &efapin);
                                                }
                                                else if(test==6) { /* 2&3 */
                                                        /* make new vert in center of new edge */
@@ -4737,15 +4735,15 @@ void subdivideflag(int flag, float rad, int beauty)
                                                        eve= addvertlist(vec);
                                                        eve->f |= flag;
                                                        /*New faces*/
-                                                       addvlak_subdiv(evl, 1, 11, 3+4, 4, eve, &evlpin);
-                                                       addvlak_subdiv(evl, 1, 2, 2+4, 11, eve, &evlpin);
+                                                       addface_subdiv(efa, 1, 11, 3+4, 4, eve, &efapin);
+                                                       addface_subdiv(efa, 1, 2, 2+4, 11, eve, &efapin);
                                                        /* orig face becomes small corner */
-                                                       evl->v1=e2->vn;
-                                                       evl->v2=evl->v3;
-                                                       evl->v3=e3->vn;
-                                                       evl->v4=eve;
+                                                       efa->v1=e2->vn;
+                                                       efa->v2=efa->v3;
+                                                       efa->v3=e3->vn;
+                                                       efa->v4=eve;
 
-                                                       set_wuv(4, evl, 2+4, 3, 3+4, 11, &evlpin);
+                                                       set_wuv(4, efa, 2+4, 3, 3+4, 11, &efapin);
                                                }
                                                else if(test==12) { /* 3&4 */
                                                        /* make new vert in center of new edge */
@@ -4755,15 +4753,15 @@ void subdivideflag(int flag, float rad, int beauty)
                                                        eve= addvertlist(vec);
                                                        eve->f |= flag;
                                                        /*New Faces*/
-                                                       addvlak_subdiv(evl, 2, 12, 4+4, 1, eve, &evlpin);
-                                                       addvlak_subdiv(evl, 2, 3, 3+4, 12, eve, &evlpin);
+                                                       addface_subdiv(efa, 2, 12, 4+4, 1, eve, &efapin);
+                                                       addface_subdiv(efa, 2, 3, 3+4, 12, eve, &efapin);
                                                        /* orig face becomes small corner */
-                                                       evl->v1=e3->vn;
-                                                       evl->v2=evl->v4;
-                                                       evl->v3=e4->vn;
-                                                       evl->v4=eve;
+                                                       efa->v1=e3->vn;
+                                                       efa->v2=efa->v4;
+                                                       efa->v3=e4->vn;
+                                                       efa->v4=eve;
 
-                                                       set_wuv(4, evl, 3+4, 4, 4+4, 12, &evlpin);
+                                                       set_wuv(4, efa, 3+4, 4, 4+4, 12, &efapin);
                                                }
                                                else if(test==9) { /* 4&1 */
                                                        /* make new vert in center of new edge */
@@ -4773,64 +4771,64 @@ void subdivideflag(int flag, float rad, int beauty)
                                                        eve= addvertlist(vec);
                                                        eve->f |= flag;
                                                        /*New Faces*/
-                                                       addvlak_subdiv(evl, 3, 13, 1+4, 2, eve, &evlpin);
-                                                       addvlak_subdiv(evl, 3, 4,  4+4,13, eve, &evlpin);
+                                                       addface_subdiv(efa, 3, 13, 1+4, 2, eve, &efapin);
+                                                       addface_subdiv(efa, 3, 4,  4+4,13, eve, &efapin);
                                                        /* orig face becomes small corner */
-                                                       evl->v2=evl->v1;
-                                                       evl->v1=e4->vn;
-                                                       evl->v3=e1->vn;
-                                                       evl->v4=eve;
+                                                       efa->v2=efa->v1;
+                                                       efa->v1=e4->vn;
+                                                       efa->v3=e1->vn;
+                                                       efa->v4=eve;
 
-                                                       set_wuv(4, evl, 4+4, 1, 1+4, 13, &evlpin);
+                                                       set_wuv(4, efa, 4+4, 1, 1+4, 13, &efapin);
                                                }
                                                else if(test==5) { /* 1&3 */
-                                                       addvlak_subdiv(evl, 1+4, 2, 3, 3+4, 0, &evlpin);
-                                                       evl->v2= e1->vn;
-                                                       evl->v3= e3->vn;
-                                                       set_wuv(4, evl, 1, 1+4, 3+4, 4, &evlpin);
+                                                       addface_subdiv(efa, 1+4, 2, 3, 3+4, 0, &efapin);
+                                                       efa->v2= e1->vn;
+                                                       efa->v3= e3->vn;
+                                                       set_wuv(4, efa, 1, 1+4, 3+4, 4, &efapin);
                                                }
                                                else if(test==10) { /* 2&4 */
-                                                       addvlak_subdiv(evl, 2+4, 3, 4, 4+4, 0, &evlpin);
-                                                       evl->v3= e2->vn;
-                                                       evl->v4= e4->vn;
-                                                       set_wuv(4, evl, 1, 2, 2+4, 4+4, &evlpin);
+                                                       addface_subdiv(efa, 2+4, 3, 4, 4+4, 0, &efapin);
+                                                       efa->v3= e2->vn;
+                                                       efa->v4= e4->vn;
+                                                       set_wuv(4, efa, 1, 2, 2+4, 4+4, &efapin);
                                                }/* Unfortunately, there is no way to avoid tris on 1 or 3 edges*/
                                                else if(test==7) { /*1,2&3 */
-                                                       addvlak_subdiv(evl, 1+4, 2+4, 3+4, 0, 0, &evlpin);
-                                                       evl->v2= e1->vn;
-                                                       evl->v3= e3->vn;
-                                                       set_wuv(4, evl, 1, 1+4, 3+4, 4, &evlpin);
+                                                       addface_subdiv(efa, 1+4, 2+4, 3+4, 0, 0, &efapin);
+                                                       efa->v2= e1->vn;
+                                                       efa->v3= e3->vn;
+                                                       set_wuv(4, efa, 1, 1+4, 3+4, 4, &efapin);
                                                }
                                                
                                                else if(test==14) { /* 2,3&4 */
-                                                       addvlak_subdiv(evl, 2+4, 3+4, 4+4, 0, 0, &evlpin);
-                                                       evl->v3= e2->vn;
-                                                       evl->v4= e4->vn;
-                                                       set_wuv(4, evl, 1, 2, 2+4, 4+4, &evlpin);
+                                                       addface_subdiv(efa, 2+4, 3+4, 4+4, 0, 0, &efapin);
+                                                       efa->v3= e2->vn;
+                                                       efa->v4= e4->vn;
+                                                       set_wuv(4, efa, 1, 2, 2+4, 4+4, &efapin);
                                                }
                                                else if(test==13) {/* 1,3&4 */
-                                                       addvlak_subdiv(evl, 3+4, 4+4, 1+4, 0, 0, &evlpin);
-                                                       evl->v4= e3->vn;
-                                                       evl->v1= e1->vn;
-                                                       set_wuv(4, evl, 1+4, 3, 3, 3+4, &evlpin);
+                                                       addface_subdiv(efa, 3+4, 4+4, 1+4, 0, 0, &efapin);
+                                                       efa->v4= e3->vn;
+                                                       efa->v1= e1->vn;
+                                                       set_wuv(4, efa, 1+4, 3, 3, 3+4, &efapin);
                                                }
                                                else if(test==11) { /* 1,2,&4 */
-                                                       addvlak_subdiv(evl, 4+4, 1+4, 2+4, 0, 0, &evlpin);
-                                                       evl->v1= e4->vn;
-                                                       evl->v2= e2->vn;
-                                                       set_wuv(4, evl, 4+4, 2+4, 3, 4, &evlpin);
+                                                       addface_subdiv(efa, 4+4, 1+4, 2+4, 0, 0, &efapin);
+                                                       efa->v1= e4->vn;
+                                                       efa->v2= e2->vn;
+                                                       set_wuv(4, efa, 4+4, 2+4, 3, 4, &efapin);
                                                }
                                        }
-                                       evl->e1= addedgelist(evl->v1, evl->v2, NULL);
-                                       evl->e2= addedgelist(evl->v2, evl->v3, NULL);
-                                       if(evl->v4) evl->e3= addedgelist(evl->v3, evl->v4, NULL);
-                                       else evl->e3= addedgelist(evl->v3, evl->v1, NULL);
-                                       if(evl->v4) evl->e4= addedgelist(evl->v4, evl->v1, NULL);
-                                       else evl->e4= NULL;
+                                       efa->e1= addedgelist(efa->v1, efa->v2, NULL);
+                                       efa->e2= addedgelist(efa->v2, efa->v3, NULL);
+                                       if(efa->v4) efa->e3= addedgelist(efa->v3, efa->v4, NULL);
+                                       else efa->e3= addedgelist(efa->v3, efa->v1, NULL);
+                                       if(efa->v4) efa->e4= addedgelist(efa->v4, efa->v1, NULL);
+                                       else efa->e4= NULL;
                                }
                        }
                }
-               evl= evl->prev;
+               efa= efa->prev;
        }
 
        /* remove all old edges, if needed make new ones */
@@ -4860,7 +4858,7 @@ void adduplicateflag(int flag)
           new verts have flag 'flag' set */
        EditVert *eve, *v1, *v2, *v3, *v4;
        EditEdge *eed;
-       EditVlak *evl;
+       EditFace *efa;
 
        /* vertices first */
        eve= em->verts.last;
@@ -4896,37 +4894,37 @@ void adduplicateflag(int flag)
        }
 
        /* then dupicate faces */
-       evl= em->faces.first;
-       while(evl) {
-               if( (evl->v1->f & 128) && (evl->v2->f & 128) && (evl->v3->f & 128) ) {
-                       if(evl->v4) {
-                               if(evl->v4->f & 128) {
-                                       v1= evl->v1->vn;
-                                       v2= evl->v2->vn;
-                                       v3= evl->v3->vn;
-                                       v4= evl->v4->vn;
-                                       addvlaklist(v1, v2, v3, v4, evl);
+       efa= em->faces.first;
+       while(efa) {
+               if( (efa->v1->f & 128) && (efa->v2->f & 128) && (efa->v3->f & 128) ) {
+                       if(efa->v4) {
+                               if(efa->v4->f & 128) {
+                                       v1= efa->v1->vn;
+                                       v2= efa->v2->vn;
+                                       v3= efa->v3->vn;
+                                       v4= efa->v4->vn;
+                                       addfacelist(v1, v2, v3, v4, efa);
                                }
                        }
                        else {
-                               v1= evl->v1->vn;
-                               v2= evl->v2->vn;
-                               v3= evl->v3->vn;
-                               addvlaklist(v1, v2, v3, 0, evl);
+                               v1= efa->v1->vn;
+                               v2= efa->v2->vn;
+                               v3= efa->v3->vn;
+                               addfacelist(v1, v2, v3, 0, efa);
                        }
                }
-               evl= evl->next;
+               efa= efa->next;
        }
 }
 
-static void delvlakflag(int flag)
+static void delfaceflag(int flag)
 {
        EditMesh *em = G.editMesh;
        /* delete all faces with 'flag', including edges and loose vertices */
        /* in vertices the 'flag' is cleared */
        EditVert *eve,*nextve;
        EditEdge *eed, *nexted;
-       EditVlak *evl,*nextvl;
+       EditFace *efa,*nextvl;
 
        eed= em->edges.first;
        while(eed) {
@@ -4934,34 +4932,34 @@ static void delvlakflag(int flag)
                eed= eed->next;
        }
 
-       evl= em->faces.first;
-       while(evl) {
-               nextvl= evl->next;
-               if(vlakselectedAND(evl, flag)) {
+       efa= em->faces.first;
+       while(efa) {
+               nextvl= efa->next;
+               if(faceselectedAND(efa, flag)) {
                        
-                       evl->e1->f= 1;
-                       evl->e2->f= 1;
-                       evl->e3->f= 1;
-                       if(evl->e4) {
-                               evl->e4->f= 1;
+                       efa->e1->f= 1;
+                       efa->e2->f= 1;
+                       efa->e3->f= 1;
+                       if(efa->e4) {
+                               efa->e4->f= 1;
                        }
                                                                
-                       BLI_remlink(&em->faces, evl);
-                       free_editvlak(evl);
+                       BLI_remlink(&em->faces, efa);
+                       free_editface(efa);
                }
-               evl= nextvl;
+               efa= nextvl;
        }
        /* all faces with 1, 2 (3) vertices selected: make sure we keep the edges */
-       evl= em->faces.first;
-       while(evl) {
-               evl->e1->f= 0;
-               evl->e2->f= 0;
-               evl->e3->f= 0;
-               if(evl->e4) {
-                       evl->e4->f= 0;
+       efa= em->faces.first;
+       while(efa) {
+               efa->e1->f= 0;
+               efa->e2->f= 0;
+               efa->e3->f= 0;
+               if(efa->e4) {
+                       efa->e4->f= 0;
                }
 
-               evl= evl->next;
+               efa= efa->next;
        }
        
        /* test all edges for vertices with 'flag', and clear */
@@ -5041,7 +5039,7 @@ void split_mesh(void)
        /* make duplicate first */
        adduplicateflag(1);
        /* old faces have 3x flag 128 set, delete them */
-       delvlakflag(128);
+       delfaceflag(128);
 
        waitcursor(0);
 
@@ -5078,7 +5076,7 @@ void separate_mesh(void)
        EditMesh *em = G.editMesh;
        EditVert *eve, *v1;
        EditEdge *eed, *e1;
-       EditVlak *evl, *vl1;
+       EditFace *efa, *vl1;
        Object *oldob;
        Mesh *me, *men;
        Base *base, *oldbase;
@@ -5101,7 +5099,7 @@ void separate_mesh(void)
         * 2: then do a split if needed.
         * 3. put apart: all NOT selected verts, edges, faces
         * 4. call loadobeditdata(): this will be the new object
-        * 5. freelist en oude verts, eds, vlakken weer terughalen
+        * 5. freelist and get back old verts, edges, facs
         */
        
        /* make only obedit selected */
@@ -5129,7 +5127,7 @@ void separate_mesh(void)
                /* SPLIT: first make duplicate */
                adduplicateflag(1);
                /* SPLIT: old faces have 3x flag 128 set, delete these ones */
-               delvlakflag(128);
+               delfaceflag(128);
        }
        
        /* set apart: everything that is not selected */
@@ -5152,14 +5150,14 @@ void separate_mesh(void)
                }
                eed= e1;
        }
-       evl= em->faces.first;
-       while(evl) {
-               vl1= evl->next;
-               if( (evl->v1->f & 1)==0 || (evl->v2->f & 1)==0 || (evl->v3->f & 1)==0 ) {
-                       BLI_remlink(&em->faces, evl);
-                       BLI_addtail(&edvl, evl);
+       efa= em->faces.first;
+       while(efa) {
+               vl1= efa->next;
+               if( (efa->v1->f & 1)==0 || (efa->v2->f & 1)==0 || (efa->v3->f & 1)==0 ) {
+                       BLI_remlink(&em->faces, efa);
+                       BLI_addtail(&edvl, efa);
                }
-               evl= vl1;
+               efa= vl1;
        }
        
        oldob= G.obedit;