minor update, "Draw Handles" wasnt working when disabled everywhere and replaced...
authorCampbell Barton <ideasman42@gmail.com>
Sat, 1 Dec 2007 23:25:00 +0000 (23:25 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sat, 1 Dec 2007 23:25:00 +0000 (23:25 +0000)
16 files changed:
source/blender/blenkernel/intern/curve.c
source/blender/blenkernel/intern/ipo.c
source/blender/include/blendef.h
source/blender/python/api2_2x/Curve.c
source/blender/src/buttons_editing.c
source/blender/src/drawipo.c
source/blender/src/drawobject.c
source/blender/src/drawview.c
source/blender/src/edit.c
source/blender/src/editcurve.c
source/blender/src/editipo.c
source/blender/src/editipo_lib.c
source/blender/src/editipo_mods.c
source/blender/src/editobject.c
source/blender/src/editview.c
source/blender/src/transform_conversions.c

index 6676bf0e03ffcfe69ae7c03d6d3d37e33553a666..fcf44fb07752466c08dc6e1d88cbb805219506aa 100644 (file)
@@ -1539,8 +1539,8 @@ void makeBevelList(Object *ob)
                                                bevp->y= prevbezt->vec[1][1];
                                                bevp->z= prevbezt->vec[1][2];
                                                bevp->alfa= prevbezt->alfa;
-                                               bevp->f1= 1;
-                                               bevp->f2= 0;
+                                               bevp->f1= SELECT;
+                                               bevp->f2= SELECT;
                                                bevp++;
                                                bl->nr++;
                                                bl->flag= 1;
@@ -1645,7 +1645,7 @@ void makeBevelList(Object *ob)
                        if( fabs(bevp0->x-bevp1->x)<0.00001 ) {
                                if( fabs(bevp0->y-bevp1->y)<0.00001 ) {
                                        if( fabs(bevp0->z-bevp1->z)<0.00001 ) {
-                                               bevp0->f2= 1;
+                                               bevp0->f2= SELECT;
                                                bl->flag++;
                                        }
                                }
@@ -2162,7 +2162,7 @@ void calchandleNurb(BezTriple *bezt, BezTriple *prev, BezTriple *next, int mode)
        if(len1==0.0) len1=1.0;
        if(len2==0.0) len2=1.0;
 
-       if(bezt->f1 & 1) { /* order of calculation */
+       if(bezt->f1 & SELECT) { /* order of calculation */
                if(bezt->h2==HD_ALIGN) {        /* aligned */
                        len= len2/len1;
                        p2[3]= p2[0]+len*(p2[0]-p2[-3]);
@@ -2238,9 +2238,9 @@ void testhandlesNurb(Nurb *nu)
        a= nu->pntsu;
        while(a--) {
                flag= 0;
-               if(bezt->f1 & 1) flag++;
-               if(bezt->f2 & 1) flag += 2;
-               if(bezt->f3 & 1) flag += 4;
+               if(bezt->f1 & SELECT) flag++;
+               if(bezt->f2 & SELECT) flag += 2;
+               if(bezt->f3 & SELECT) flag += 4;
 
                if( !(flag==0 || flag==7) ) {
                        if(bezt->h1==HD_AUTO) {   /* auto */
index 6f6711a2a18bf7998808254b8da06e43c47a2a76..876f1c50a93a5ba11713d5092105cde8d5f059e8 100644 (file)
@@ -530,9 +530,9 @@ void testhandles_ipocurve(IpoCurve *icu)
        a= icu->totvert;
        while(a--) {
                flag= 0;
-               if(bezt->f1 & 1) flag++;
-               if(bezt->f2 & 1) flag += 2;
-               if(bezt->f3 & 1) flag += 4;
+               if(bezt->f1 & SELECT) flag++;
+               if(bezt->f2 & SELECT) flag += 2;
+               if(bezt->f3 & SELECT) flag += 4;
 
                if( !(flag==0 || flag==7) ) {
                        if(bezt->h1==HD_AUTO) {   /* auto */
@@ -2349,7 +2349,7 @@ void add_to_cfra_elem(ListBase *lb, BezTriple *bezt)
                
                if( ce->cfra==bezt->vec[1][0] ) {
                        /* do because of double keys */
-                       if(bezt->f2 & 1) ce->sel= bezt->f2;
+                       if(bezt->f2 & SELECT) ce->sel= bezt->f2;
                        return;
                }
                else if(ce->cfra > bezt->vec[1][0]) break;
index 55fa1fd884042a16db02e138665a29b98a6ff033..b237a2dd6016049513c354b09930e1ab8e065511 100644 (file)
 #define ISPOIN4(a, b, c, d, e) ( (a->b) && (a->c) && (a->d) && (a->e) )
 
 #define BEZSELECTED(bezt)   (((bezt)->f1 & 1) || ((bezt)->f2 & 1) || ((bezt)->f3 & 1))
+/* for curve objects in editmode that can have hidden handles - may use for IPO's later */
+#define BEZSELECTED_HIDDENHANDLES(bezt)   ((G.f & G_HIDDENHANDLES) ? (bezt)->f2 & 1 : BEZSELECTED(bezt))
 
 /* psfont */
 #define FNT_PDRAW 1
index e88ab0eeeff00671bf535e432d56bb9bcd0df151..adf7c39b45c333c6c9856e63bc956ef90d1406f7 100644 (file)
@@ -821,9 +821,9 @@ static PyObject *Curve_appendNurb( BPy_Curve * self, PyObject * value )
                        new_nurb->type = CU_BEZIER;
                        new_nurb->bezt->h1 = HD_ALIGN;
                        new_nurb->bezt->h2 = HD_ALIGN;
-                       new_nurb->bezt->f1 = 1;
-                       new_nurb->bezt->f2 = 1;
-                       new_nurb->bezt->f3 = 1;
+                       new_nurb->bezt->f1 = SELECT;
+                       new_nurb->bezt->f2 = SELECT;
+                       new_nurb->bezt->f3 = SELECT;
                        new_nurb->bezt->hide = 0;
                        /* calchandlesNurb( new_nurb ); */
                } else {        /* set up bp */
index 9536da086d14cfc46b8d5cc2f35c2128e85afd55..24191e8c38c7f188832c334d3e1b563567907033 100644 (file)
@@ -521,14 +521,14 @@ void do_common_editbuts(unsigned short event) // old name, is a mix of object an
                                                        while(a--) {
                                                                if(bezt->hide==0) {
                                                                        if(event==B_MATSEL) {
-                                                                               bezt->f1 |= 1;
-                                                                               bezt->f2 |= 1;
-                                                                               bezt->f3 |= 1;
+                                                                               bezt->f1 |= SELECT;
+                                                                               bezt->f2 |= SELECT;
+                                                                               bezt->f3 |= SELECT;
                                                                        }
                                                                        else {
-                                                                               bezt->f1 &= ~1;
-                                                                               bezt->f2 &= ~1;
-                                                                               bezt->f3 &= ~1;
+                                                                               bezt->f1 &= ~SELECT;
+                                                                               bezt->f2 &= ~SELECT;
+                                                                               bezt->f3 &= ~SELECT;
                                                                        }
                                                                }
                                                                bezt++;
index 94832561b86831c0ee3e5bb2d55491c2ab3ae31d..5759a5f352248e4331900539582ca7fd14d89a47 100644 (file)
@@ -1190,7 +1190,7 @@ static void draw_ipovertices(int sel)
                                        ok= 0;
                                        
                                        if(ei->flag & IPO_EDIT) {
-                                               if( (bezt->f2 & 1) == sel ) ok= 1;
+                                               if( (bezt->f2 & SELECT) == sel ) ok= 1;
                                        }
                                        else ok= 1;
                                        
@@ -1212,15 +1212,15 @@ static void draw_ipovertices(int sel)
                                        if(ei->flag & IPO_EDIT) {
                                                if(ei->icu->ipo==IPO_BEZ) {
                                                        /* Draw the editmode hendels for a bezier curve */
-                                                       if( (bezt->f1 & 1) == sel)/* && G.v2d->cur.xmin < bezt->vec[0][0] < G.v2d->cur.xmax)*/
+                                                       if( (bezt->f1 & SELECT) == sel)/* && G.v2d->cur.xmin < bezt->vec[0][0] < G.v2d->cur.xmax)*/
                                                                bglVertex3fv(bezt->vec[0]);
                                                        
-                                                       if( (bezt->f3 & 1) == sel)/* && G.v2d->cur.xmin < bezt->vec[2][0] < G.v2d->cur.xmax)*/
+                                                       if( (bezt->f3 & SELECT) == sel)/* && G.v2d->cur.xmin < bezt->vec[2][0] < G.v2d->cur.xmax)*/
                                                                bglVertex3fv(bezt->vec[2]);
                                                        
                                                }
                                                
-                                               if( (bezt->f2 & 1) == sel) /* && G.v2d->cur.xmin < bezt->vec[1][0] < G.v2d->cur.xmax)*/
+                                               if( (bezt->f2 & SELECT) == sel) /* && G.v2d->cur.xmin < bezt->vec[1][0] < G.v2d->cur.xmax)*/
                                                        bglVertex3fv(bezt->vec[1]);
                                                
                                        }
@@ -1261,7 +1261,7 @@ static void draw_ipohandles(int sel)
                                b= ei->icu->totvert;
                                while(b--) {
                                        
-                                       if( (bezt->f2 & 1)==sel) {
+                                       if( (bezt->f2 & SELECT)==sel) {
                                                fp= bezt->vec[0];
                                                cpack(col[bezt->h1]);
                                                
@@ -1282,7 +1282,7 @@ static void draw_ipohandles(int sel)
                                                glVertex2fv(fp); glVertex2fv(fp+3); 
                                                glEnd();
                                        }
-                                       else if( (bezt->f3 & 1)==sel) {
+                                       else if( (bezt->f3 & SELECT)==sel) {
                                                fp= bezt->vec[1];
                                                cpack(col[bezt->h2]);
                                                
@@ -1730,16 +1730,16 @@ static void ipo_editvertex_buts(uiBlock *block, SpaceIpo *si, float min, float m
                                        b= ei->icu->totvert;
                                        while(b--) {
                                                // all three selected 
-                                               if(bezt->f2 & 1) {
+                                               if(bezt->f2 & SELECT) {
                                                        VecAddf(median, median, bezt->vec[1]);
                                                        tot++;
                                                }
                                                else {
-                                                       if(bezt->f1 & 1) {
+                                                       if(bezt->f1 & SELECT) {
                                                                VecAddf(median, median, bezt->vec[0]);
                                                                tot++;
                                                        }
-                                                       if(bezt->f3 & 1) {
+                                                       if(bezt->f3 & SELECT) {
                                                                VecAddf(median, median, bezt->vec[2]);
                                                                tot++;
                                                        }
@@ -1824,16 +1824,16 @@ static void ipo_editvertex_buts(uiBlock *block, SpaceIpo *si, float min, float m
                                                b= ei->icu->totvert;
                                                while(b--) {
                                                        // all three selected
-                                                       if(bezt->f2 & 1) {
+                                                       if(bezt->f2 & SELECT) {
                                                                VecAddf(bezt->vec[0], bezt->vec[0], median);
                                                                VecAddf(bezt->vec[1], bezt->vec[1], median);
                                                                VecAddf(bezt->vec[2], bezt->vec[2], median);
                                                        }
                                                        else {
-                                                               if(bezt->f1 & 1) {
+                                                               if(bezt->f1 & SELECT) {
                                                                        VecAddf(bezt->vec[0], bezt->vec[0], median);
                                                                }
-                                                               if(bezt->f3 & 1) {
+                                                               if(bezt->f3 & SELECT) {
                                                                        VecAddf(bezt->vec[2], bezt->vec[2], median);
                                                                }
                                                        }
index 899fda103bd6bd3dd36c582c250c8792257a1cf1..790db21374470824cb9cb4da8fbd00cdf8b2c86b 100644 (file)
@@ -3729,7 +3729,7 @@ static void tekenhandlesN(Nurb *nu, short sel)
                a= nu->pntsu;
                while(a--) {
                        if(bezt->hide==0) {
-                               if( (bezt->f2 & 1)==sel) {
+                               if( (bezt->f2 & SELECT)==sel) {
                                        fp= bezt->vec[0];
                                        
                                        cpack(col[bezt->h1]);
@@ -3740,14 +3740,14 @@ static void tekenhandlesN(Nurb *nu, short sel)
                                        glVertex3fv(fp+3); 
                                        glVertex3fv(fp+6); 
                                }
-                               else if( (bezt->f1 & 1)==sel) {
+                               else if( (bezt->f1 & SELECT)==sel) {
                                        fp= bezt->vec[0];
                                        
                                        cpack(col[bezt->h1]);
                                        glVertex3fv(fp); 
                                        glVertex3fv(fp+3); 
                                }
-                               else if( (bezt->f3 & 1)==sel) {
+                               else if( (bezt->f3 & SELECT)==sel) {
                                        fp= bezt->vec[1];
                                        
                                        cpack(col[bezt->h2]);
@@ -3785,11 +3785,11 @@ static void tekenvertsN(Nurb *nu, short sel)
                while(a--) {
                        if(bezt->hide==0) {
                                if (G.f & G_HIDDENHANDLES) {
-                                       if((bezt->f2 & 1)==sel) bglVertex3fv(bezt->vec[1]);
+                                       if((bezt->f2 & SELECT)==sel) bglVertex3fv(bezt->vec[1]);
                                } else {
-                                       if((bezt->f1 & 1)==sel) bglVertex3fv(bezt->vec[0]);
-                                       if((bezt->f2 & 1)==sel) bglVertex3fv(bezt->vec[1]);
-                                       if((bezt->f3 & 1)==sel) bglVertex3fv(bezt->vec[2]);
+                                       if((bezt->f1 & SELECT)==sel) bglVertex3fv(bezt->vec[0]);
+                                       if((bezt->f2 & SELECT)==sel) bglVertex3fv(bezt->vec[1]);
+                                       if((bezt->f3 & SELECT)==sel) bglVertex3fv(bezt->vec[2]);
                                }
                        }
                        bezt++;
index a02f1065b5bf034e291ab374f8ae30c07f1124e3..daf2804e44efc17d81aa242ae46ccea672281af5 100644 (file)
@@ -1637,18 +1637,18 @@ static void v3d_editvertex_buts(uiBlock *block, Object *ob, float lim)
                                bezt= nu->bezt;
                                a= nu->pntsu;
                                while(a--) {
-                                       if(bezt->f2 & 1) {
+                                       if(bezt->f2 & SELECT) {
                                                VecAddf(median, median, bezt->vec[1]);
                                                tot++;
                                                median[4]+= bezt->weight;
                                                totweight++;
                                        }
                                        else {
-                                               if(bezt->f1 & 1) {
+                                               if(bezt->f1 & SELECT) {
                                                        VecAddf(median, median, bezt->vec[0]);
                                                        tot++;
                                                }
-                                               if(bezt->f3 & 1) {
+                                               if(bezt->f3 & SELECT) {
                                                        VecAddf(median, median, bezt->vec[2]);
                                                        tot++;
                                                }
@@ -1811,17 +1811,17 @@ static void v3d_editvertex_buts(uiBlock *block, Object *ob, float lim)
                                        bezt= nu->bezt;
                                        a= nu->pntsu;
                                        while(a--) {
-                                               if(bezt->f2 & 1) {
+                                               if(bezt->f2 & SELECT) {
                                                        VecAddf(bezt->vec[0], bezt->vec[0], median);
                                                        VecAddf(bezt->vec[1], bezt->vec[1], median);
                                                        VecAddf(bezt->vec[2], bezt->vec[2], median);
                                                        bezt->weight+= median[4];
                                                }
                                                else {
-                                                       if(bezt->f1 & 1) {
+                                                       if(bezt->f1 & SELECT) {
                                                                VecAddf(bezt->vec[0], bezt->vec[0], median);
                                                        }
-                                                       if(bezt->f3 & 1) {
+                                                       if(bezt->f3 & SELECT) {
                                                                VecAddf(bezt->vec[2], bezt->vec[2], median);
                                                        }
                                                }
index accdd4b8990b91c4634da93395870707a6f64dbd..2e4b89869c4a06aac5ddf9354a3dbb1bf196e77a 100644 (file)
@@ -1077,26 +1077,26 @@ static void make_trans_verts(float *min, float *max, int mode)
                                bezt= nu->bezt;
                                while(a--) {
                                        if(bezt->hide==0) {
-                                               if((mode & 1) || (bezt->f1 & 1)) {
+                                               if((mode & 1) || (bezt->f1 & SELECT)) {
                                                        VECCOPY(tv->oldloc, bezt->vec[0]);
                                                        tv->loc= bezt->vec[0];
-                                                       tv->flag= bezt->f1 & 1;
+                                                       tv->flag= bezt->f1 & SELECT;
                                                        tv++;
                                                        tottrans++;
                                                }
-                                               if((mode & 1) || (bezt->f2 & 1)) {
+                                               if((mode & 1) || (bezt->f2 & SELECT)) {
                                                        VECCOPY(tv->oldloc, bezt->vec[1]);
                                                        tv->loc= bezt->vec[1];
                                                        tv->val= &(bezt->alfa);
                                                        tv->oldval= bezt->alfa;
-                                                       tv->flag= bezt->f2 & 1;
+                                                       tv->flag= bezt->f2 & SELECT;
                                                        tv++;
                                                        tottrans++;
                                                }
-                                               if((mode & 1) || (bezt->f3 & 1)) {
+                                               if((mode & 1) || (bezt->f3 & SELECT)) {
                                                        VECCOPY(tv->oldloc, bezt->vec[2]);
                                                        tv->loc= bezt->vec[2];
-                                                       tv->flag= bezt->f3 & 1;
+                                                       tv->flag= bezt->f3 & SELECT;
                                                        tv++;
                                                        tottrans++;
                                                }
index 358e6332d6d54b8edcc54aab81b83e4b311ac75a..25110a971e4415fec4e89ea2503713eb3a8063f8 100644 (file)
@@ -158,7 +158,7 @@ static short select_bpoint(BPoint *bp, short selstatus, short flag, short hidden
 
 static short swap_selection_beztriple(BezTriple *bezt)
 {
-       if(bezt->f2 & 1)
+       if(bezt->f2 & SELECT)
                return select_beztriple(bezt, DESELECT, 1, VISIBLE);
        else
                return select_beztriple(bezt, SELECT, 1, VISIBLE);
@@ -166,7 +166,7 @@ static short swap_selection_beztriple(BezTriple *bezt)
 
 static short swap_selection_bpoint(BPoint *bp)
 {
-       if(bp->f1 & 1)
+       if(bp->f1 & SELECT)
                return select_bpoint(bp, DESELECT, 1, VISIBLE);
        else
                return select_bpoint(bp, SELECT, 1, VISIBLE);
@@ -182,7 +182,7 @@ short isNurbsel(Nurb *nu)
                bezt= nu->bezt;
                a= nu->pntsu;
                while(a--) {
-                       if( (bezt->f1 & 1) || (bezt->f2 & 1) || (bezt->f3 & 1) ) return 1;
+                       if( (bezt->f1 & SELECT) || (bezt->f2 & SELECT) || (bezt->f3 & SELECT) ) return 1;
                        bezt++;
                }
        }
@@ -190,7 +190,7 @@ short isNurbsel(Nurb *nu)
                bp= nu->bp;
                a= nu->pntsu*nu->pntsv;
                while(a--) {
-                       if( (bp->f1 & 1) ) return 1;
+                       if( (bp->f1 & SELECT) ) return 1;
                        bp++;
                }
        }
@@ -207,7 +207,7 @@ int isNurbsel_count(Nurb *nu)
                bezt= nu->bezt;
                a= nu->pntsu;
                while(a--) {
-                       if( (bezt->f1 & 1) || (bezt->f2 & 1) || (bezt->f3 & 1) ) sel++;
+                       if( (bezt->f1 & SELECT) || (bezt->f2 & SELECT) || (bezt->f3 & SELECT) ) sel++;
                        bezt++;
                }
        }
@@ -215,7 +215,7 @@ int isNurbsel_count(Nurb *nu)
                bp= nu->bp;
                a= nu->pntsu*nu->pntsv;
                while(a--) {
-                       if( (bp->f1 & 1) ) sel++;
+                       if( (bp->f1 & SELECT) ) sel++;
                        bp++;
                }
        }
@@ -1319,9 +1319,9 @@ static void select_adjacent_cp(short next, short cont, short selstatus)
                        while(a--) {
                                if(a-abs(next) < 0) break;
                                sel= 0;
-                               if((lastsel==0) && (bezt->hide==0) && ((bezt->f2 & 1) || (selstatus==0))) {
+                               if((lastsel==0) && (bezt->hide==0) && ((bezt->f2 & SELECT) || (selstatus==0))) {
                                        bezt+=next;
-                                       if(!(bezt->f2 & 1) || (selstatus==0)) {
+                                       if(!(bezt->f2 & SELECT) || (selstatus==0)) {
                                                sel= select_beztriple(bezt, selstatus, 1, VISIBLE);     
                                                if((sel==1) && (cont==0)) lastsel= 1;
                                        }                                                       
@@ -1372,9 +1372,9 @@ static short nurb_has_selected_cps()
                        bezt= nu->bezt;
                        while(a--) {
                                if(bezt->hide==0) {
-                                       if((bezt->f1 & 1)
-                                       || (bezt->f2 & 1)
-                                       || (bezt->f3 & 1)) return 1;
+                                       if((bezt->f1 & SELECT)
+                                       || (bezt->f2 & SELECT)
+                                       || (bezt->f3 & SELECT)) return 1;
                                }
                                bezt++;
                        }
@@ -1383,7 +1383,7 @@ static short nurb_has_selected_cps()
                        a= nu->pntsu*nu->pntsv;
                        bp= nu->bp;
                        while(a--) {
-                               if((bp->hide==0) && (bp->f1 & 1)) return 1;
+                               if((bp->hide==0) && (bp->f1 & SELECT)) return 1;
                                bp++;
                        }
                }
@@ -1428,7 +1428,7 @@ void hideNurb(int swap)
                        a= nu->pntsu;
                        sel= 0;
                        while(a--) {
-                               if(BEZSELECTED(bezt)) {
+                               if(BEZSELECTED_HIDDENHANDLES(bezt)) {
                                        select_beztriple(bezt, DESELECT, 1, HIDDEN);
                                        bezt->hide= 1;
                                }
@@ -1520,12 +1520,11 @@ void selectswapNurb()
                        a= nu->pntsu;
                        while(a--) {
                                if(bezt->hide==0) {
-                                       if(bezt->f1 & 1) bezt->f1 &= ~1; 
-                                       else bezt->f1 |= 1;
-                                       if(bezt->f2 & 1) bezt->f2 &= ~1; 
-                                       else bezt->f2 |= 1;
-                                       if(bezt->f3 & 1) bezt->f3 &= ~1; 
-                                       else bezt->f3 |= 1;
+                                       bezt->f2 ^= SELECT; /* always do the center point */
+                                       if ((G.f & G_HIDDENHANDLES)==0) {
+                                               bezt->f1 ^= SELECT;
+                                               bezt->f3 ^= SELECT;
+                                       }
                                }
                                bezt++;
                        }
@@ -1584,7 +1583,7 @@ void subdivideNurb()
                                bezt= prevbezt+1;
                        }
                        while(a--) {
-                               if( BEZSELECTED(prevbezt) && BEZSELECTED(bezt) ) amount++;
+                               if( BEZSELECTED_HIDDENHANDLES(prevbezt) && BEZSELECTED_HIDDENHANDLES(bezt) ) amount++;
                                prevbezt= bezt;
                                bezt++;
                        }
@@ -1608,7 +1607,7 @@ void subdivideNurb()
                                        memcpy(beztn, prevbezt, sizeof(BezTriple));
                                        beztn++;
 
-                                       if( BEZSELECTED(prevbezt) && BEZSELECTED(bezt) ) {
+                                       if( BEZSELECTED_HIDDENHANDLES(prevbezt) && BEZSELECTED_HIDDENHANDLES(bezt) ) {
                                                memcpy(beztn, bezt, sizeof(BezTriple));
                                                
                                                /* midpoint subdividing */
@@ -2000,7 +1999,7 @@ static void findselectedNurbvert(Nurb **nu, BezTriple **bezt, BPoint **bp)
                        bezt1= nu1->bezt;
                        a= nu1->pntsu;
                        while(a--) {
-                               if( (bezt1->f1 & 1) || (bezt1->f2 & 1) || (bezt1->f3 & 1) ) {
+                               if( (bezt1->f1 & SELECT) || (bezt1->f2 & SELECT) || (bezt1->f3 & SELECT) ) {
                                        if(*nu!=0 && *nu!= nu1) {
                                                *nu= 0;
                                                *bp= 0;
@@ -2535,23 +2534,23 @@ void addsegment_nurb()
                        if( (nu->type & 7)==CU_BEZIER ) {
                                bezt= nu->bezt;
                                if(nu1==0) {
-                                       if( BEZSELECTED(bezt) ) nu1= nu;
+                                       if( BEZSELECTED_HIDDENHANDLES(bezt) ) nu1= nu;
                                        else {
                                                bezt= bezt+(nu->pntsu-1);
-                                               if( BEZSELECTED(bezt) ) {
+                                               if( BEZSELECTED_HIDDENHANDLES(bezt) ) {
                                                        nu1= nu;
                                                        switchdirectionNurb(nu);
                                                }
                                        }
                                }
                                else if(nu2==0) {
-                                       if( BEZSELECTED(bezt) ) {
+                                       if( BEZSELECTED_HIDDENHANDLES(bezt) ) {
                                                nu2= nu;
                                                switchdirectionNurb(nu);
                                        }
                                        else {
                                                bezt= bezt+(nu->pntsu-1);
-                                               if( BEZSELECTED(bezt) ) {
+                                               if( BEZSELECTED_HIDDENHANDLES(bezt) ) {
                                                        nu2= nu;
                                                }
                                        }
@@ -2683,28 +2682,16 @@ void mouse_nurb()
                else {
                        if(bezt) {
                                if(hand==1) {
-                                       if(bezt->f2 & 1) select_beztriple(bezt, DESELECT, 1, HIDDEN);
+                                       if(bezt->f2 & SELECT) select_beztriple(bezt, DESELECT, 1, HIDDEN);
                                        else select_beztriple(bezt, SELECT, 1, HIDDEN);
-                               }
-                               else if(hand==0) {
-                                       if(bezt->f1 & 1) {
-                                               bezt->f1 &= ~1; 
-                                       }
-                                       else {
-                                               bezt->f1 |= 1; 
-                                       }
-                               }
-                               else {
-                                       if(bezt->f3 & 1) { 
-                                               bezt->f3 &= ~1; 
-                                       }
-                                       else { 
-                                               bezt->f3 |= 1; 
-                                       }
+                               } else if(hand==0) {
+                                       bezt->f1 ^= SELECT;
+                               } else {
+                                       bezt->f3 ^= SELECT;
                                }
                        }
                        else {
-                               if(bp->f1 & 1) select_bpoint(bp, DESELECT, 1, HIDDEN);
+                               if(bp->f1 & SELECT) select_bpoint(bp, DESELECT, 1, HIDDEN);
                                else {
                                        select_bpoint(bp, SELECT, 1, HIDDEN);
                                        lastselbp= bp;
@@ -2863,7 +2850,7 @@ void addvert_Nurb(int mode)
                                (BezTriple*)MEM_callocN((nu->pntsu+1) * sizeof(BezTriple), "addvert_Nurb");
                        memcpy(newbezt+1, bezt, nu->pntsu*sizeof(BezTriple));
                        *newbezt= *bezt;
-                       newbezt->f1= newbezt->f2= newbezt->f3= 1;
+                       newbezt->f1= newbezt->f2= newbezt->f3= SELECT;
                        if(newbezt->h1 >= 0) newbezt->h2= newbezt->h1;
                        else newbezt->h2= newbezt->h1= HD_ALIGN; /* does this ever happen? */
                        VECCOPY(temp, bezt->vec[1]);
@@ -2881,7 +2868,7 @@ void addvert_Nurb(int mode)
                        MEM_freeN(nu->bezt);
                        nu->bezt= newbezt;
                        newbezt+= nu->pntsu;
-                       newbezt->f1= newbezt->f2= newbezt->f3= 1;
+                       newbezt->f1= newbezt->f2= newbezt->f3= SELECT;
                        if(newbezt->h1 >= 0) newbezt->h2= newbezt->h1;
                        else newbezt->h2= newbezt->h1= HD_ALIGN; /* does this ever happen? */
                        bezt= nu->bezt+nu->pntsu-1;
@@ -3036,7 +3023,7 @@ void makecyclicNurb()
                                a= nu->pntsu;
                                bezt= nu->bezt;
                                while(a--) {
-                                       if( BEZSELECTED(bezt) ) {
+                                       if( BEZSELECTED_HIDDENHANDLES(bezt) ) {
                                                if(nu->flagu & CU_CYCLIC) nu->flagu--;
                                                else nu->flagu++;
                                                break;
@@ -3428,7 +3415,7 @@ void select_less_nurb()
                                a= nu->pntsu;
                                bezt= nu->bezt;
                                while(a--) {
-                                       if((bezt->hide==0) && (bezt->f2 & 1)) {
+                                       if((bezt->hide==0) && (bezt->f2 & SELECT)) {
                                                if(lastsel==1) sel= 1;
                                                else sel= 0;
                                                                                                
@@ -3437,22 +3424,22 @@ void select_less_nurb()
                                                if(a==nu->pntsu-1) sel++; 
                                                else { 
                                                        bezt--;
-                                                       if((bezt->hide==0) && (bezt->f2 & 1)) sel++;
+                                                       if((bezt->hide==0) && (bezt->f2 & SELECT)) sel++;
                                                        bezt++;
                                                }
                                                
                                                if(a==0) sel++;
                                                else {
                                                        bezt++;
-                                                       if((bezt->hide==0) && (bezt->f2 & 1)) sel++;
+                                                       if((bezt->hide==0) && (bezt->f2 & SELECT)) sel++;
                                                        bezt--;
                                                }
-                                                                                               
+
                                                if(sel!=2) {
                                                        select_beztriple(bezt, DESELECT, 1, VISIBLE);   
-                                                       lastsel= 1;                                             
-                                               }                               
-                                               else lastsel= 0;                                        
+                                                       lastsel= 1;
+                                               }
+                                               else lastsel= 0;
                                        }
                                        else lastsel= 0;
                                                
@@ -3650,7 +3637,7 @@ void delNurb()
                                a= nu->pntsu;
                                if(a) {
                                        while(a) {
-                                               if( BEZSELECTED(bezt) );
+                                               if( BEZSELECTED_HIDDENHANDLES(bezt) );
                                                else break;
                                                a--;
                                                bezt++;
@@ -3687,7 +3674,7 @@ void delNurb()
                        if( (nu->type & 7)==CU_BEZIER ) {
                                bezt= nu->bezt;
                                for(a=0;a<nu->pntsu;a++) {
-                                       if( BEZSELECTED(bezt) ) {
+                                       if( BEZSELECTED_HIDDENHANDLES(bezt) ) {
                                                memcpy(bezt, bezt+1, (nu->pntsu-a-1)*sizeof(BezTriple));
                                                nu->pntsu--;
                                                a--;
@@ -3740,14 +3727,14 @@ void delNurb()
                        if( (nu->type & 7)==CU_BEZIER ) {
                                bezt= nu->bezt;
                                for(a=0; a<nu->pntsu-1; a++) {
-                                       if( BEZSELECTED(bezt) ) {
+                                       if( BEZSELECTED_HIDDENHANDLES(bezt) ) {
                                                bezt1= bezt;
                                                bezt2= bezt+1;
-                                               if( (bezt2->f1 & 1) || (bezt2->f2 & 1) || (bezt2->f3 & 1) ) ;
+                                               if( (bezt2->f1 & SELECT) || (bezt2->f2 & SELECT) || (bezt2->f3 & SELECT) ) ;
                                                else {  /* maybe do not make cyclic */
                                                        if(a==0 && (nu->flagu & 1) ) {
                                                                bezt2= bezt+(nu->pntsu-1);
-                                                               if( (bezt2->f1 & 1) || (bezt2->f2 & 1) || (bezt2->f3 & 1) ) {
+                                                               if( (bezt2->f1 & SELECT) || (bezt2->f2 & SELECT) || (bezt2->f3 & SELECT) ) {
                                                                        nu->flagu--;
                                                                        DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
                                                                        allqueue(REDRAWVIEW3D, 0);
@@ -4056,7 +4043,7 @@ Nurb *addNurbprim(int type, int stype, int newname)
                                (BezTriple*)MEM_callocN(2 * sizeof(BezTriple), "addNurbprim1");
                        bezt= nu->bezt;
                        bezt->h1= bezt->h2= HD_ALIGN;
-                       bezt->f1= bezt->f2= bezt->f3= 1;
+                       bezt->f1= bezt->f2= bezt->f3= SELECT;
                        bezt->radius = 1.0;
 
                        for(a=0;a<3;a++) {
@@ -4071,7 +4058,7 @@ Nurb *addNurbprim(int type, int stype, int newname)
 
                        bezt++;
                        bezt->h1= bezt->h2= HD_ALIGN;
-                       bezt->f1= bezt->f2= bezt->f3= 1;
+                       bezt->f1= bezt->f2= bezt->f3= SELECT;
                        bezt->radius = bezt->weight = 1.0;
 
                        for(a=0;a<3;a++) {
@@ -4167,7 +4154,7 @@ Nurb *addNurbprim(int type, int stype, int newname)
                                VECCOPY(bezt->vec[a], cent);
                        }
                        bezt->h1= bezt->h2= HD_AUTO;
-                       bezt->f1= bezt->f2= bezt->f3= 1;
+                       bezt->f1= bezt->f2= bezt->f3= SELECT;
                        bezt->vec[1][0]+= -grid;
                        for(a=0;a<3;a++) Mat3MulVecfl(imat,bezt->vec[a]);
                        bezt->radius = bezt->weight = 1.0;
@@ -4177,7 +4164,7 @@ Nurb *addNurbprim(int type, int stype, int newname)
                                VECCOPY(bezt->vec[a], cent);
                        }
                        bezt->h1= bezt->h2= HD_AUTO;
-                       bezt->f1= bezt->f2= bezt->f3= 1;
+                       bezt->f1= bezt->f2= bezt->f3= SELECT;
                        bezt->vec[1][1]+= grid;
                        for(a=0;a<3;a++) Mat3MulVecfl(imat,bezt->vec[a]);
                        bezt->radius = bezt->weight = 1.0;
@@ -4187,7 +4174,7 @@ Nurb *addNurbprim(int type, int stype, int newname)
                                VECCOPY(bezt->vec[a], cent);
                        }
                        bezt->h1= bezt->h2= HD_AUTO;
-                       bezt->f1= bezt->f2= bezt->f3= 1;
+                       bezt->f1= bezt->f2= bezt->f3= SELECT;
                        bezt->vec[1][0]+= grid;
                        for(a=0;a<3;a++) Mat3MulVecfl(imat,bezt->vec[a]);
                        bezt->radius = bezt->weight = 1.0;
@@ -4197,7 +4184,7 @@ Nurb *addNurbprim(int type, int stype, int newname)
                                VECCOPY(bezt->vec[a], cent);
                        }
                        bezt->h1= bezt->h2= HD_AUTO;
-                       bezt->f1= bezt->f2= bezt->f3= 1;
+                       bezt->f1= bezt->f2= bezt->f3= SELECT;
                        bezt->vec[1][1]+= -grid;
                        for(a=0;a<3;a++) Mat3MulVecfl(imat,bezt->vec[a]);
                        bezt->radius = bezt->weight = 1.0;
@@ -4546,7 +4533,7 @@ void clear_tilt()
                        bezt= nu->bezt;
                        a= nu->pntsu;
                        while(a--) {
-                               if(BEZSELECTED(bezt)) bezt->alfa= 0.0;
+                               if(BEZSELECTED_HIDDENHANDLES(bezt)) bezt->alfa= 0.0;
                                bezt++;
                        }
                }
@@ -4582,9 +4569,9 @@ int bezt_compare (const void *e1, const void *e2)
 
        /* Check selected flags : Ensures that selected keys will be listed first */
 
-       if ((b1->f2 & 1) && !(b2->f2 & 1))
+       if ((b1->f2 & SELECT) && !(b2->f2 & SELECT))
                return -1;
-       if (!(b1->f2 & 1) && (b2->f2 & 1))
+       if (!(b1->f2 & SELECT) && (b2->f2 & SELECT))
                return 1;
 
        return 0;
index d0442196bb4d5865bf864ee4cbc632e81a2ece9c..53ccb13a1d37c0af7b2d565bd9fe4cf6235af87d 100644 (file)
@@ -1273,11 +1273,11 @@ void get_status_editipo(void)
                                                b= ei->icu->totvert;
                                                while(b--) {
                                                        if(ei->icu->ipo==IPO_BEZ) {
-                                                               if(bezt->f1 & 1) totipo_vertsel++;
-                                                               if(bezt->f3 & 1) totipo_vertsel++;
+                                                               if(bezt->f1 & SELECT) totipo_vertsel++;
+                                                               if(bezt->f3 & SELECT) totipo_vertsel++;
                                                                totipo_vert+= 2;
                                                        }
-                                                       if(bezt->f2 & 1) totipo_vertsel++;
+                                                       if(bezt->f2 & SELECT) totipo_vertsel++;
                                                        
                                                        totipo_vert++;
                                                        bezt++;
@@ -1514,16 +1514,16 @@ void mouse_select_ipo(void)
                                                bezt->f1= bezt->f2= bezt->f3= 0;
                                        }
                                        else {
-                                               bezt->f1= bezt->f2= bezt->f3= 1;
+                                               bezt->f1= bezt->f2= bezt->f3= SELECT;
                                        }
                                }
                                else if(hand==0) {
-                                       if(bezt->f1 & 1) bezt->f1= 0;
-                                       else bezt->f1= 1;
+                                       if(bezt->f1 & SELECT) bezt->f1= 0;
+                                       else bezt->f1= SELECT;
                                }
                                else {
-                                       if(bezt->f3 & 1) bezt->f3= 0;
-                                       else bezt->f3= 1;
+                                       if(bezt->f3 & SELECT) bezt->f3= 0;
+                                       else bezt->f3= SELECT;
                                }
                        }                               
                }
@@ -1532,10 +1532,10 @@ void mouse_select_ipo(void)
                        
                        if(bezt) {
                                if(hand==1) {
-                                       bezt->f1|= 1; bezt->f2|= 1; bezt->f3|= 1;
+                                       bezt->f1|= SELECT; bezt->f2|= SELECT; bezt->f3|= SELECT;
                                }
-                               else if(hand==0) bezt->f1|= 1;
-                               else bezt->f3|= 1;
+                               else if(hand==0) bezt->f1 |= SELECT;
+                               else bezt->f3 |= SELECT;
                        }
                }
        }
@@ -3409,7 +3409,7 @@ void add_duplicate_editipo(void)
                                b= icu->totvert;
                                bezt= icu->bezt;
                                while(b--) {
-                                       if(bezt->f2 & 1) tot++;
+                                       if(bezt->f2 & SELECT) tot++;
                                        bezt++;
                                }
                                
@@ -3420,7 +3420,7 @@ void add_duplicate_editipo(void)
                                        b= icu->totvert-tot;
                                        while(b--) {
                                                *beztn= *bezt;
-                                               if(bezt->f2 & 1) {
+                                               if(bezt->f2 & SELECT) {
                                                        beztn->f1= beztn->f2= beztn->f3= 0;
                                                        beztn++;
                                                        *beztn= *bezt;
@@ -3474,7 +3474,7 @@ void remove_doubles_ipo(void)
                                while(b--) {
                                        
                                        /* can we remove? */
-                                       if(mode==2 || (bezt->f2 & 1)) {
+                                       if(mode==2 || (bezt->f2 & SELECT)) {
                                        
                                                /* are the points different? */
                                                if( fabs( bezt->vec[1][0]-newb->vec[1][0] ) > 0.9 ) {
@@ -3788,7 +3788,7 @@ void join_ipo(int mode)
                                b= icu->totvert;
                                bezt= icu->bezt;
                                while(b--) {
-                                       if(bezt->f2 & 1) tot++;
+                                       if(bezt->f2 & SELECT) tot++;
                                        bezt++;
                                }
                                
@@ -3805,7 +3805,7 @@ void join_ipo(int mode)
                                        b= icu->totvert+tot+1;
                                        while(b--) {
                                                
-                                               if(bezt->f2 & 1) {
+                                               if(bezt->f2 & SELECT) {
                                                        if(tot==0) *newb= *bezt;
                                                        else {
                                                                VecAddf(newb->vec[0], newb->vec[0], bezt->vec[0]);
@@ -3923,7 +3923,7 @@ void ipo_snap(short event)
                                while(a--) {
                                        ok= 0;
                                        if(totipo_vert) {
-                                                if(bezt->f2 & 1) ok= 1;
+                                               if(bezt->f2 & SELECT) ok= 1;
                                        }
                                        else ok= 1;
                                        
@@ -4033,7 +4033,7 @@ void ipo_mirror(short mode)
                                while(a--) {
                                        ok= 0;
                                        if(totipo_vert) {
-                                               if(bezt->f2 & 1) ok= 1;
+                                               if(bezt->f2 & SELECT) ok= 1;
                                        }
                                        else ok= 1;
                                        
@@ -4521,7 +4521,7 @@ void add_to_ipokey(ListBase *lb, BezTriple *bezt, int nr, int len)
                if( ik->val==bezt->vec[1][0] ) {
                        if(ik->data[nr]==0) {   /* double points! */
                                ik->data[nr]= bezt;
-                               if(bezt->f2 & 1) ik->flag= 1;
+                               if(bezt->f2 & SELECT) ik->flag= 1;
                                return;
                        }
                }
@@ -4538,7 +4538,7 @@ void add_to_ipokey(ListBase *lb, BezTriple *bezt, int nr, int len)
        ikn->data[nr]= bezt;
        ikn->val= bezt->vec[1][0];
 
-       if(bezt->f2 & 1) ikn->flag= 1;
+       if(bezt->f2 & SELECT) ikn->flag= 1;
 }
 
 void make_ipokey(void)
@@ -4576,7 +4576,7 @@ void make_ipokey(void)
                for(a=0; a<G.sipo->totipo; a++) {
                        if(ik->data[a]) {
                                bezt= ik->data[a];
-                               if(bezt->f2 & 1) sel++;
+                               if(bezt->f2 & SELECT) sel++;
                                else desel++;
                        }
                }
@@ -4585,14 +4585,14 @@ void make_ipokey(void)
                        if(ik->data[a]) {
                                bezt= ik->data[a];
                                if(sel) {
-                                       bezt->f1 |= 1;
-                                       bezt->f2 |= 1;
-                                       bezt->f3 |= 1;
+                                       bezt->f1 |= SELECT;
+                                       bezt->f2 |= SELECT;
+                                       bezt->f3 |= SELECT;
                                }
                                else {
-                                       bezt->f1 &= ~1;
-                                       bezt->f2 &= ~1;
-                                       bezt->f3 &= ~1;
+                                       bezt->f1 &= ~SELECT;
+                                       bezt->f2 &= ~SELECT;
+                                       bezt->f3 &= ~SELECT;
                                }
                        }
                }
@@ -4690,7 +4690,7 @@ void make_ipokey_transform(Object *ob, ListBase *lb, int sel)
                                bezt= icu->bezt;
                                a= icu->totvert;
                                while(a--) {
-                                       if(sel==0 || (bezt->f2 & 1)) {
+                                       if(sel==0 || (bezt->f2 & SELECT)) {
                                                add_to_ipokey(lb, bezt, adrcode, OB_TOTIPO);
                                        }
                                        bezt++;
@@ -5045,14 +5045,14 @@ void make_ipo_transdata (TransInfo *t)
                                                for (b=0; b < ei->icu->totvert; b++, bezt++) {
                                                        /* only include handles if selected, and interpolaton mode uses beztriples */
                                                        if (ei->icu->ipo==IPO_BEZ) {
-                                                               if (bezt->f1 & 1)
+                                                               if (bezt->f1 & SELECT)
                                                                        bezt_to_transdata(td++, td2d++, bezt->vec[0], bezt->vec[1], 1, onlytime);
-                                                               if (bezt->f3 & 1)
+                                                               if (bezt->f3 & SELECT)
                                                                        bezt_to_transdata(td++, td2d++, bezt->vec[2], bezt->vec[1], 1, onlytime);
                                                        }
                                                        
                                                        /* only include main vert if selected */
-                                                       if (bezt->f2 & 1) {
+                                                       if (bezt->f2 & SELECT) {
                                                                bezt_to_transdata(td++, td2d++, bezt->vec[1], bezt->vec[1], 1, onlytime);
                                                        }
                                                }
@@ -5198,7 +5198,7 @@ static void beztmap_to_data (TransInfo *t, EditIpo *ei, BeztMap *bezms, int totv
                        if (totipo_vertsel) {
                                /* only selected verts */
                                if (ei->icu->ipo==IPO_BEZ) {
-                                       if (bezm->bezt->f1 & 1) {
+                                       if (bezm->bezt->f1 & SELECT) {
                                                if (td->loc2d == bezm->bezt->vec[0]) {
                                                        if (bezm->swapHs == 1)
                                                                td->loc2d= (bezts + bezm->newIndex)->vec[2];
@@ -5207,7 +5207,7 @@ static void beztmap_to_data (TransInfo *t, EditIpo *ei, BeztMap *bezms, int totv
                                                        adjusted[j] = 1;
                                                }
                                        }
-                                       if (bezm->bezt->f3 & 1) {
+                                       if (bezm->bezt->f3 & SELECT) {
                                                if (td->loc2d == bezm->bezt->vec[2]) {
                                                        if (bezm->swapHs == 1)
                                                                td->loc2d= (bezts + bezm->newIndex)->vec[0];
@@ -5217,7 +5217,7 @@ static void beztmap_to_data (TransInfo *t, EditIpo *ei, BeztMap *bezms, int totv
                                                }
                                        }
                                }
-                               if (bezm->bezt->f2 & 1) {
+                               if (bezm->bezt->f2 & SELECT) {
                                        if (td->loc2d == bezm->bezt->vec[1]) {
                                                td->loc2d= (bezts + bezm->newIndex)->vec[1];
                                                adjusted[j] = 1;
index b0d15910d95b80d2379f4277cd8e37c87c46bcf3..41044ad13d7e2e617d7b1c4ae4dee201ceab776a 100644 (file)
@@ -299,7 +299,7 @@ void boundbox_ipocurve(IpoCurve *icu, int selectedonly)
                        bezt= icu->bezt;
                        while(a--) {
                                if(icu->vartype & IPO_BITS) {
-                                       if((bezt->f2 & 1) || !selectedonly) {
+                                       if((bezt->f2 & SELECT) || !selectedonly) {
                                                vec[0]= bezt->vec[1][0];
                                                vec[1]= 0.0;
                                                DO_MINMAX(vec, min, max);
@@ -309,13 +309,13 @@ void boundbox_ipocurve(IpoCurve *icu, int selectedonly)
                                        }
                                }
                                else {
-                                       if((bezt->f1 & 1) || !selectedonly) {
+                                       if((bezt->f1 & SELECT) || !selectedonly) {
                                                if(icu->ipo==IPO_BEZ && a!=icu->totvert-1)
                                                        DO_MINMAX(bezt->vec[0], min, max);
                                        }
-                                       if((bezt->f2 & 1) || !selectedonly)
+                                       if((bezt->f2 & SELECT) || !selectedonly)
                                                DO_MINMAX(bezt->vec[1], min, max);
-                                       if((bezt->f3 & 1) || !selectedonly) {
+                                       if((bezt->f3 & SELECT) || !selectedonly) {
                                                if(icu->ipo==IPO_BEZ && a!=0)
                                                        DO_MINMAX(bezt->vec[2], min, max);
                                        }
index c0fea15ac88c858d886e9faf8780d9d268ced035..0fe0ab33b02ab801d5138404cfd6c3ffe4b080c7 100644 (file)
@@ -139,7 +139,7 @@ void swap_selectall_editipo(void)
                                                        bezt->f1= bezt->f2= bezt->f3= 0;
                                                }
                                                else {
-                                                       bezt->f1= bezt->f2= bezt->f3= 1;
+                                                       bezt->f1= bezt->f2= bezt->f3= SELECT;
                                                }
                                                bezt++;
                                        }
@@ -375,32 +375,32 @@ static int selected_bezier_loop(int (*looptest)(EditIpo *),
 int select_bezier_add(BezTriple *bezt) 
 {
        /* Select the bezier triple */
-       bezt->f1 |= 1;
-       bezt->f2 |= 1;
-       bezt->f3 |= 1;
+       bezt->f1 |= SELECT;
+       bezt->f2 |= SELECT;
+       bezt->f3 |= SELECT;
        return 0;
 }
 
 int select_bezier_subtract(BezTriple *bezt) 
 {
        /* Deselect the bezier triple */
-       bezt->f1 &= ~1;
-       bezt->f2 &= ~1;
-       bezt->f3 &= ~1;
+       bezt->f1 &= ~SELECT;
+       bezt->f2 &= ~SELECT;
+       bezt->f3 &= ~SELECT;
        return 0;
 }
 
 int select_bezier_invert(BezTriple *bezt) 
 {
        /* Invert the selection for the bezier triple */
-       bezt->f2 ^= 1;
-       if ( bezt->f2 & 1 ) {
-               bezt->f1 |= 1;
-               bezt->f3 |= 1;
+       bezt->f2 ^= SELECT;
+       if ( bezt->f2 & SELECT ) {
+               bezt->f1 |= SELECT;
+               bezt->f3 |= SELECT;
        }
        else {
-               bezt->f1 &= ~1;
-               bezt->f3 &= ~1;
+               bezt->f1 &= ~SELECT;
+               bezt->f3 &= ~SELECT;
        }
        return 0;
 }
@@ -976,11 +976,11 @@ void borderselect_ipo(void)
                                                        int bit= (val==LEFTMOUSE);
                                                        
                                                        if(BLI_in_rctf(&rectf, bezt->vec[0][0], bezt->vec[0][1]))
-                                                               bezt->f1 = (bezt->f1&~1) | bit;
+                                                               bezt->f1 = (bezt->f1&~SELECT) | bit;
                                                        if(BLI_in_rctf(&rectf, bezt->vec[1][0], bezt->vec[1][1]))
-                                                               bezt->f2 = (bezt->f2&~1) | bit;
+                                                               bezt->f2 = (bezt->f2&~SELECT) | bit;
                                                        if(BLI_in_rctf(&rectf, bezt->vec[2][0], bezt->vec[2][1]))
-                                                               bezt->f3 = (bezt->f3&~1) | bit;
+                                                               bezt->f3 = (bezt->f3&~SELECT) | bit;
 
                                                        bezt++;
                                                }
index 8f40742852ee41483784e0f04320fd89b005099f..8f3d9779a0dace71ad0ab625b95add62f4d02618 100644 (file)
@@ -1160,7 +1160,7 @@ void make_vertex_parent(void)
                                bezt= nu->bezt;
                                a= nu->pntsu;
                                while(a--) {
-                                       if(BEZSELECTED(bezt)) {
+                                       if(BEZSELECTED_HIDDENHANDLES(bezt)) {
                                                if(v1==0) v1= nr;
                                                else if(v2==0) v2= nr;
                                                else if(v3==0) v3= nr;
index f1e4017c264528d3b4bf82f83d9a7c916e054e52..e18b73ced49f4ebd3b8f80293516d265f1bcfc54 100644 (file)
@@ -537,14 +537,14 @@ static void do_lasso_select_curve__doSelect(void *userData, Nurb *nu, BPoint *bp
                } else {
                        if (G.f & G_HIDDENHANDLES) {
                                /* can only be beztindex==0 here since handles are hidden */
-                               bezt->f1 = bezt->f2 = bezt->f3 = data->select?(bezt->f1|1):(bezt->f1&~1);
+                               bezt->f1 = bezt->f2 = bezt->f3 = data->select?(bezt->f1|SELECT):(bezt->f1&~SELECT);
                        } else {
                                if (beztindex==0) {
-                                       bezt->f1 = data->select?(bezt->f1|1):(bezt->f1&~1);
+                                       bezt->f1 = data->select?(bezt->f1|SELECT):(bezt->f1&~SELECT);
                                } else if (beztindex==1) {
-                                       bezt->f2 = data->select?(bezt->f2|1):(bezt->f2&~1);
+                                       bezt->f2 = data->select?(bezt->f2|SELECT):(bezt->f2&~SELECT);
                                } else {
-                                       bezt->f3 = data->select?(bezt->f3|1):(bezt->f3&~1);
+                                       bezt->f3 = data->select?(bezt->f3|SELECT):(bezt->f3&~SELECT);
                                }
                        }
                }
index f280e4afdcd6beec96d3a27cf838472f4b544e72..bfb90977715313ce587af2fa1f6c8b1545a389e7 100644 (file)
@@ -1161,12 +1161,12 @@ static void createTransCurveVerts(TransInfo *t)
                        for(a=0, bezt= nu->bezt; a<nu->pntsu; a++, bezt++) {
                                if(bezt->hide==0) {
                                        if (G.f & G_HIDDENHANDLES) {
-                                               if(bezt->f2 & 1) countsel+=3;
+                                               if(bezt->f2 & SELECT) countsel+=3;
                                                if(propmode) count+= 3;
                                        } else {
-                                               if(bezt->f1 & 1) countsel++;
-                                               if(bezt->f2 & 1) countsel++;
-                                               if(bezt->f3 & 1) countsel++;
+                                               if(bezt->f1 & SELECT) countsel++;
+                                               if(bezt->f2 & SELECT) countsel++;
+                                               if(bezt->f3 & SELECT) countsel++;
                                                if(propmode) count+= 3;
                                        }
                                }
@@ -1200,8 +1200,8 @@ static void createTransCurveVerts(TransInfo *t)
                                if(bezt->hide==0) {
                                        
                                        if(             propmode ||
-                                                       ((bezt->f2 & 1) && (G.f & G_HIDDENHANDLES)) ||
-                                                       ((bezt->f1 & 1) && (G.f & G_HIDDENHANDLES)==0)
+                                                       ((bezt->f2 & SELECT) && (G.f & G_HIDDENHANDLES)) ||
+                                                       ((bezt->f1 & SELECT) && (G.f & G_HIDDENHANDLES)==0)
                                          ) {
                                                VECCOPY(td->iloc, bezt->vec[0]);
                                                td->loc= bezt->vec[0];
@@ -1221,11 +1221,11 @@ static void createTransCurveVerts(TransInfo *t)
                                        }
                                        
                                        /* This is the Curve Point, the other two are handles */
-                                       if(propmode || (bezt->f2 & 1)) {
+                                       if(propmode || (bezt->f2 & SELECT)) {
                                                VECCOPY(td->iloc, bezt->vec[1]);
                                                td->loc= bezt->vec[1];
                                                VECCOPY(td->center, td->loc);
-                                               if(bezt->f2 & 1) td->flag= TD_SELECTED;
+                                               if(bezt->f2 & SELECT) td->flag= TD_SELECTED;
                                                else td->flag= 0;
                                                td->ext = NULL;
                                                td->tdi = NULL;
@@ -1248,13 +1248,13 @@ static void createTransCurveVerts(TransInfo *t)
                                                tail++;
                                        }
                                        if(             propmode ||
-                                                       ((bezt->f1 & 1) && (G.f & G_HIDDENHANDLES)) ||
-                                                       ((bezt->f3 & 1) && (G.f & G_HIDDENHANDLES)==0)
+                                                       ((bezt->f1 & SELECT) && (G.f & G_HIDDENHANDLES)) ||
+                                                       ((bezt->f3 & SELECT) && (G.f & G_HIDDENHANDLES)==0)
                                          ) {
                                                VECCOPY(td->iloc, bezt->vec[2]);
                                                td->loc= bezt->vec[2];
                                                VECCOPY(td->center, bezt->vec[1]);
-                                               if(bezt->f3 & 1 || (G.f & G_HIDDENHANDLES)) td->flag= TD_SELECTED;
+                                               if(bezt->f3 & SELECT || (G.f & G_HIDDENHANDLES)) td->flag= TD_SELECTED;
                                                else td->flag= 0;
                                                td->ext = NULL;
                                                td->tdi = NULL;
@@ -2251,10 +2251,10 @@ static int count_ipo_keys(Ipo *ipo, char side, float cfra)
        /* only include points that occur on the right side of cfra */
        for (icu= ipo->curve.first; icu; icu= icu->next) {
                for (i=0, bezt=icu->bezt; i < icu->totvert; i++, bezt++) {
-                       if (bezt->f2) {
+                       if (bezt->f2 & SELECT) {
                                /* fully select the other two keys */
-                               bezt->f1 |= 1;
-                               bezt->f3 |= 1;
+                               bezt->f1 |= SELECT;
+                               bezt->f3 |= SELECT;
                                
                                /* increment by 3, as there are 3 points (3 * x-coordinates) that need transform */
                                if (FrameOnMouseSide(side, bezt->vec[1][0], cfra))