Fixed fgon issues;
authorTon Roosendaal <ton@blender.org>
Mon, 29 Nov 2004 12:57:35 +0000 (12:57 +0000)
committerTon Roosendaal <ton@blender.org>
Mon, 29 Nov 2004 12:57:35 +0000 (12:57 +0000)
- removed rule restricting to co-planar fgons; isn't useful anyway. Now
  allows to fgonize the entire surface of a tube :)
- Hide/Reveil fgons cleared fgon flags
- Reveil ended with wrong selection status for verts/edges... solved with
  correctly using EM_select_edge and EM_select_face

source/blender/src/editmesh_add.c
source/blender/src/editmesh_mods.c

index 5c0379347ef492c363d5d059162a5e98d39b144c..cc18ffdba73d68e742c680bc0807369af2f6e38c 100644 (file)
@@ -174,7 +174,7 @@ static void make_fgon(void)
        EditFace *efa;
        EditEdge *eed;
        EditVert *eve;
-       float *nor=NULL, dot;   // reference
+       float *nor=NULL;        // reference
        int done=0, ret;
        
        ret= pupmenu("FGon %t|Make|Clear");
@@ -200,7 +200,7 @@ static void make_fgon(void)
        /* tagging edges. rule is:
           - edge used by exactly 2 selected faces
           - no vertices allowed with only tagged edges (return)
-          - face normals should not differ too much 
+          - face normals are allowed to difffer
         
        */
        for(eed= em->edges.first; eed; eed= eed->next) {
@@ -249,22 +249,12 @@ static void make_fgon(void)
                return;
        }
        
-       // check co-planar
+       // check for faces
        if(nor==NULL) {
                error("No faces selected to make FGon");
                return;
        }
-       for(efa= em->faces.first; efa; efa= efa->next) {
-               if(efa->f & SELECT) {
-                       dot= nor[0]*efa->n[0]+nor[1]*efa->n[1]+nor[2]*efa->n[2];
-                       if(dot<0.9 && dot > -0.9) break;
-               }
-       }
-       if(efa) {
-               error("Not a set of co-planar faces to make FGon");
-               return;
-       }
-       
+
        // and there we go
        for(eed= em->edges.first; eed; eed= eed->next) {
                if(eed->f1) {
index 76a6f8a75c98780675794df6d26d4399bd7a0a20..07fb23511ee23537f228f639539ab8c908627846 100644 (file)
@@ -1269,8 +1269,8 @@ void hide_mesh(int swap)
        
        if(G.scene->selectmode >= SCE_SELECT_EDGE) {
                for(eed= em->edges.first; eed; eed= eed->next) {
-                       if(eed->f1==1) eed->h= 1;
-                       if(eed->h) a= 1; else a= 2;
+                       if(eed->f1==1) eed->h |= 1;
+                       if(eed->h & 1) a= 1; else a= 2;
                        eed->v1->f1 |= a;
                        eed->v2->f1 |= a;
                }
@@ -1307,18 +1307,19 @@ void reveal_mesh(void)
        for(eed= em->edges.first; eed; eed= eed->next) {
                if(eed->h & 1) {
                        eed->h &= ~1;
-                       eed->f |= SELECT;
+                       EM_select_edge(eed, 1);
                }
        }
 
        for(efa= em->faces.first; efa; efa= efa->next) {
                if(efa->h) {
                        efa->h= 0;
-                       efa->f |= SELECT;
+                       EM_select_face(efa, 1);
                }
        }
        
-       EM_select_flush();
+       EM_fgon_flags();        // redo flags and indices for fgons
+       EM_selectmode_flush();
        
        allqueue(REDRAWVIEW3D, 0);
        makeDispList(G.obedit);