diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-09-08 04:23:33 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-09-08 04:23:33 +0400 |
commit | 8b6b31b41fc6ed07036ea30153131e6824fc7c7e (patch) | |
tree | 6e4afbce04f039584cdeea49d3dba3b80b0c822b /source/blender/editors | |
parent | 0ab2f675c364f2ca1212b0453bf2ffdce5ebb9ea (diff) |
Made Nurb->type only store the type rather then mixing the type with flags.
moved CU_2D to Nurb->flag in do_versions
This made simple type checks confusing to read.
many... if( (nu->type & 7)==CU_BEZIER)
replaced with ... if(nu->type == CU_BEZIER)
made setting rna curve_2d clamp the Z values. still more RNA/UI changes to do.
Diffstat (limited to 'source/blender/editors')
9 files changed, 74 insertions, 76 deletions
diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c index 4246c889de0..871f00a585c 100644 --- a/source/blender/editors/curve/editcurve.c +++ b/source/blender/editors/curve/editcurve.c @@ -194,7 +194,7 @@ int isNurbsel(Nurb *nu) BPoint *bp; int a; - if((nu->type & 7)==CU_BEZIER) { + if(nu->type == CU_BEZIER) { bezt= nu->bezt; a= nu->pntsu; while(a--) { @@ -219,7 +219,7 @@ int isNurbsel_count(Nurb *nu) BPoint *bp; int a, sel=0; - if((nu->type & 7)==CU_BEZIER) { + if(nu->type == CU_BEZIER) { bezt= nu->bezt; a= nu->pntsu; while(a--) { @@ -247,7 +247,7 @@ void printknots(Object *obedit) int a, num; for(nu= editnurb->first; nu; nu= nu->next) { - if(isNurbsel(nu) && (nu->type & 7)==CU_NURBS) { + if(isNurbsel(nu) && nu->type == CU_NURBS) { if(nu->knotsu) { num= KNOTSU(nu); for(a=0;a<num;a++) printf("knotu %d: %f\n", a, nu->knotsu[a]); @@ -300,7 +300,7 @@ void load_editNurb(Object *obedit) newnu= duplicateNurb(nu); BLI_addtail(&(cu->nurb), newnu); - if((nu->type & 7)==CU_NURBS) { + if(nu->type == CU_NURBS) { clamp_nurb_order_u(nu); } } @@ -484,7 +484,7 @@ static void setflagsNurb(ListBase *editnurb, short flag) int a; for(nu= editnurb->first; nu; nu= nu->next) { - if( (nu->type & 7)==CU_BEZIER) { + if(nu->type == CU_BEZIER) { a= nu->pntsu; bezt= nu->bezt; while(a--) { @@ -511,7 +511,7 @@ static void rotateflagNurb(ListBase *editnurb, short flag, float *cent, float ro int a; for(nu= editnurb->first; nu; nu= nu->next) { - if((nu->type & 7)==CU_NURBS) { + if(nu->type == CU_NURBS) { bp= nu->bp; a= nu->pntsu*nu->pntsv; @@ -540,7 +540,7 @@ static void translateflagNurb(ListBase *editnurb, short flag, float *vec) int a; for(nu= editnurb->first; nu; nu= nu->next) { - if( (nu->type & 7)==CU_BEZIER) { + if(nu->type == CU_BEZIER) { a= nu->pntsu; bezt= nu->bezt; while(a--) { @@ -570,7 +570,7 @@ static void weightflagNurb(ListBase *editnurb, short flag, float w, int mode) /* int a; for(nu= editnurb->first; nu; nu= nu->next) { - if((nu->type & 7)==CU_NURBS) { + if(nu->type == CU_NURBS) { a= nu->pntsu*nu->pntsv; bp= nu->bp; while(a--) { @@ -834,7 +834,7 @@ static void adduplicateflagNurb(Object *obedit, short flag) nu= editnurb->last; while(nu) { - if( (nu->type & 7)==CU_BEZIER) { + if(nu->type == CU_BEZIER) { bezt= nu->bezt; for(a=0; a<nu->pntsu; a++) { enda= -1; @@ -1381,7 +1381,7 @@ static void select_adjacent_cp(ListBase *editnurb, short next, short cont, short for(nu= editnurb->first; nu; nu= nu->next) { lastsel=0; - if((nu->type & 7)==CU_BEZIER) { + if(nu->type == CU_BEZIER) { a= nu->pntsu; bezt= nu->bezt; if(next < 0) bezt= (nu->bezt + (a-1)); @@ -1447,7 +1447,7 @@ void selectend_nurb(Object *obedit, short selfirst, short doswap, short selstatu for(nu= editnurb->first; nu; nu= nu->next) { sel= 0; - if((nu->type & 7)==CU_BEZIER) { + if(nu->type == CU_BEZIER) { a= nu->pntsu; /* which point? */ @@ -1546,7 +1546,7 @@ static short nurb_has_selected_cps(ListBase *editnurb) int a; for(nu= editnurb->first; nu; nu= nu->next) { - if((nu->type & 7)==CU_BEZIER) { + if(nu->type == CU_BEZIER) { a= nu->pntsu; bezt= nu->bezt; while(a--) { @@ -1616,7 +1616,7 @@ static int hide_exec(bContext *C, wmOperator *op) int a, sel, invert= RNA_boolean_get(op->ptr, "unselected"); for(nu= editnurb->first; nu; nu= nu->next) { - if((nu->type & 7)==CU_BEZIER) { + if(nu->type == CU_BEZIER) { bezt= nu->bezt; a= nu->pntsu; sel= 0; @@ -1690,7 +1690,7 @@ static int reveal_exec(bContext *C, wmOperator *op) for(nu= editnurb->first; nu; nu= nu->next) { nu->hide= 0; - if((nu->type & 7)==CU_BEZIER) { + if(nu->type == CU_BEZIER) { bezt= nu->bezt; a= nu->pntsu; while(a--) { @@ -1746,7 +1746,7 @@ static int select_inverse_exec(bContext *C, wmOperator *op) int a; for(nu= editnurb->first; nu; nu= nu->next) { - if((nu->type & 7)==CU_BEZIER) { + if(nu->type == CU_BEZIER) { bezt= nu->bezt; a= nu->pntsu; while(a--) { @@ -1814,7 +1814,7 @@ static int subdivide_exec(bContext *C, wmOperator *op) for(nu= editnurb->first; nu; nu= nu->next) { amount= 0; - if((nu->type & 7)==CU_BEZIER) { + if(nu->type == CU_BEZIER) { /* Insert a point into a 2D Bezier curve. Endpoints are preserved. Otherwise, all selected and inserted points are @@ -1895,7 +1895,7 @@ static int subdivide_exec(bContext *C, wmOperator *op) calchandlesNurb(nu); } - } /* End of 'if((nu->type & 7)==CU_BEZIER)' */ + } /* End of 'if(nu->type == CU_BEZIER)' */ else if (nu->pntsv==1) { /* All flat lines (ie. co-planar), except flat Nurbs. Flat NURB curves @@ -1964,7 +1964,7 @@ static int subdivide_exec(bContext *C, wmOperator *op) } } } /* End of 'else if(nu->pntsv==1)' */ - else if((nu->type & 7)==CU_NURBS) { + else if(nu->type == CU_NURBS) { /* This is a very strange test ... */ /** Subdivide NURB surfaces - nzc 30-5-'00 - @@ -2163,7 +2163,7 @@ static int subdivide_exec(bContext *C, wmOperator *op) MEM_freeN(usel); MEM_freeN(vsel); - } /* End of 'if((nu->type & 7)==CU_NURBS)' */ + } /* End of 'if(nu->type == CU_NURBS)' */ } WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); @@ -2256,7 +2256,7 @@ static void findselectedNurbvert(ListBase *editnurb, Nurb **nu, BezTriple **bezt *bezt= 0; *bp= 0; for(nu1= editnurb->first; nu1; nu1= nu1->next) { - if((nu1->type & 7)==CU_BEZIER) { + if(nu1->type == CU_BEZIER) { bezt1= nu1->bezt; a= nu1->pntsu; while(a--) { @@ -2313,7 +2313,7 @@ static int convertspline(short type, Nurb *nu) BPoint *bp; int a, c, nr; - if((nu->type & 7)==CU_POLY) { + if(nu->type == CU_POLY) { if(type==CU_BEZIER) { /* to Bezier with vecthandles */ nr= nu->pntsu; bezt = @@ -2333,13 +2333,11 @@ static int convertspline(short type, Nurb *nu) MEM_freeN(nu->bp); nu->bp= 0; nu->pntsu= nr; - nu->type &= ~7; - nu->type |= CU_BEZIER; + nu->type = CU_BEZIER; calchandlesNurb(nu); } else if(type==CU_NURBS) { - nu->type &= ~7; - nu->type |= CU_NURBS; + nu->type = CU_NURBS; nu->orderu= 4; nu->flagu &= CU_CYCLIC; /* disable all flags except for cyclic */ nu->flagu += 4; @@ -2352,7 +2350,7 @@ static int convertspline(short type, Nurb *nu) } } } - else if((nu->type & 7)==CU_BEZIER) { /* Bezier */ + else if(nu->type == CU_BEZIER) { /* Bezier */ if(type==0 || type==4) { /* to Poly or Nurb */ nr= 3*nu->pntsu; nu->bp = MEM_callocN(nr * sizeof(BPoint), "setsplinetype"); @@ -2390,8 +2388,7 @@ static int convertspline(short type, Nurb *nu) nu->pntsv= 1; nu->orderu= 4; nu->orderv= 1; - nu->type &= ~7; - nu->type+= type; + nu->type |= type; if(nu->flagu & CU_CYCLIC) c= nu->orderu-1; else c= 0; if(type== 4) { @@ -2401,9 +2398,9 @@ static int convertspline(short type, Nurb *nu) } } } - else if((nu->type & 7)==CU_NURBS) { - if(type==0) { /* to Poly */ - nu->type &= ~7; + else if(nu->type == CU_NURBS) { + if(type==CU_POLY) { + nu->type = CU_POLY; if(nu->knotsu) MEM_freeN(nu->knotsu); /* python created nurbs have a knotsu of zero */ nu->knotsu= NULL; if(nu->knotsv) MEM_freeN(nu->knotsv); @@ -2438,8 +2435,7 @@ static int convertspline(short type, Nurb *nu) MEM_freeN(nu->knotsu); nu->knotsu= NULL; nu->pntsu= nr; - nu->type &= ~7; - nu->type |= CU_BEZIER; + nu->type = CU_BEZIER; } } } @@ -2799,7 +2795,7 @@ static void merge_2_nurb(wmOperator *op, ListBase *editnurb, Nurb *nu1, Nurb *nu } } - if((nu1->type & 7)==CU_NURBS) { + if(nu1->type == CU_NURBS) { /* merge knots */ makeknots(nu1, 1); @@ -2903,7 +2899,7 @@ static int make_segment_exec(bContext *C, wmOperator *op) /* find both nurbs and points, nu1 will be put behind nu2 */ for(nu= editnurb->first; nu; nu= nu->next) { if((nu->flagu & CU_CYCLIC)==0) { /* not cyclic */ - if( (nu->type & 7)==CU_BEZIER ) { + if(nu->type == CU_BEZIER) { bezt= nu->bezt; if(nu1==0) { if( BEZSELECTED_HIDDENHANDLES(bezt) ) nu1= nu; @@ -2960,7 +2956,7 @@ static int make_segment_exec(bContext *C, wmOperator *op) if((nu1 && nu2) && (nu1!=nu2)) { if( nu1->type==nu2->type) { - if((nu1->type & 7)==CU_BEZIER) { + if(nu1->type == CU_BEZIER) { bezt = (BezTriple*)MEM_mallocN((nu1->pntsu+nu2->pntsu) * sizeof(BezTriple), "addsegmentN"); memcpy(bezt, nu2->bezt, nu2->pntsu*sizeof(BezTriple)); @@ -2986,7 +2982,7 @@ static int make_segment_exec(bContext *C, wmOperator *op) BLI_remlink(editnurb, nu2); /* now join the knots */ - if((nu1->type & 7)==CU_NURBS) { + if(nu1->type == CU_NURBS) { if(nu1->knotsu==NULL) { makeknots(nu1, 1); } @@ -3266,7 +3262,7 @@ static int addvert_Nurb(bContext *C, short mode, float location[3]) findselectedNurbvert(editnurb, &nu, &bezt, &bp); if(bezt==0 && bp==0) return OPERATOR_CANCELLED; - if((nu->type & 7)==CU_BEZIER) { + if(nu->type == CU_BEZIER) { /* which bezpoint? */ if(bezt== nu->bezt) { /* first */ BEZ_DESEL(bezt); @@ -3485,7 +3481,7 @@ static int toggle_cyclic_exec(bContext *C, wmOperator *op) for(nu= editnurb->first; nu; nu= nu->next) { if( nu->pntsu>1 || nu->pntsv>1) { - if( (nu->type & 7)==CU_POLY ) { + if(nu->type == CU_POLY) { a= nu->pntsu; bp= nu->bp; while(a--) { @@ -3496,7 +3492,7 @@ static int toggle_cyclic_exec(bContext *C, wmOperator *op) bp++; } } - else if( (nu->type & 7)==CU_BEZIER ) { + else if(nu->type == CU_BEZIER) { a= nu->pntsu; bezt= nu->bezt; while(a--) { @@ -3508,7 +3504,7 @@ static int toggle_cyclic_exec(bContext *C, wmOperator *op) } calchandlesNurb(nu); } - else if(nu->pntsv==1 && (nu->type & 7)==CU_NURBS) { + else if(nu->pntsv==1 && nu->type == CU_NURBS) { if (nu->knotsu) { /* if check_valid_nurb_u fails the knotsu can be NULL */ a= nu->pntsu; bp= nu->bp; @@ -3959,7 +3955,7 @@ static int select_less_exec(bContext *C, wmOperator *op) for(nu= editnurb->first; nu; nu= nu->next) { lastsel=0; /* check what type of curve/nurb it is */ - if((nu->type & 7)==CU_BEZIER) { + if(nu->type == CU_BEZIER) { a= nu->pntsu; bezt= nu->bezt; while(a--) { @@ -4105,7 +4101,7 @@ static int select_random_exec(bContext *C, wmOperator *op) /* select elements */ for(i=1, nu= editnurb->first; nu; nu= nu->next) { - if((nu->type & 7)==CU_BEZIER) { + if(nu->type == CU_BEZIER) { bezt= nu->bezt; a= nu->pntsu; while(a--) { @@ -4249,7 +4245,7 @@ static int delete_exec(bContext *C, wmOperator *op) nu= editnurb->first; while(nu) { next= nu->next; - if( (nu->type & 7)==CU_BEZIER ) { + if(nu->type == CU_BEZIER) { bezt= nu->bezt; a= nu->pntsu; if(a) { @@ -4285,7 +4281,7 @@ static int delete_exec(bContext *C, wmOperator *op) /* Never allow the order to exceed the number of points - note, this is ok but changes unselected nurbs, disable for now */ /* - if ((nu!= NULL) && ((nu->type & 7)==CU_NURBS)) { + if ((nu!= NULL) && (nu->type == CU_NURBS)) { clamp_nurb_order_u(nu); } */ @@ -4296,7 +4292,7 @@ static int delete_exec(bContext *C, wmOperator *op) while(nu) { next= nu->next; type= 0; - if( (nu->type & 7)==CU_BEZIER ) { + if(nu->type == CU_BEZIER) { bezt= nu->bezt; for(a=0;a<nu->pntsu;a++) { if( BEZSELECTED_HIDDENHANDLES(bezt) ) { @@ -4339,7 +4335,7 @@ static int delete_exec(bContext *C, wmOperator *op) /* Never allow the order to exceed the number of points\ - note, this is ok but changes unselected nurbs, disable for now */ /* - if ((nu->type & 7)==CU_NURBS) { + if (nu->type == CU_NURBS) { clamp_nurb_order_u(nu); }*/ } @@ -4356,7 +4352,7 @@ static int delete_exec(bContext *C, wmOperator *op) nu1= 0; while(nu) { next= nu->next; - if( (nu->type & 7)==CU_BEZIER ) { + if(nu->type == CU_BEZIER) { bezt= nu->bezt; for(a=0; a<nu->pntsu-1; a++) { if( BEZSELECTED_HIDDENHANDLES(bezt) ) { @@ -4730,7 +4726,7 @@ Nurb *add_nurbs_primitive(bContext *C, int type, int newname) /* these types call this function to return a Nurb */ if (stype!=CU_PRIM_TUBE && stype!=CU_PRIM_DONUT) { nu = (Nurb*)MEM_callocN(sizeof(Nurb), "addNurbprim"); - nu->type= type; + nu->type= cutype; nu->resolu= 4; nu->resolv= 4; } @@ -4743,6 +4739,7 @@ Nurb *add_nurbs_primitive(bContext *C, int type, int newname) rename_id((ID *)obedit->data, "Curve"); } if(cutype==CU_BEZIER) { + nu->flag= CU_2D; nu->pntsu= 2; nu->bezt = (BezTriple*)MEM_callocN(2 * sizeof(BezTriple), "addNurbprim1"); @@ -4851,6 +4848,7 @@ Nurb *add_nurbs_primitive(bContext *C, int type, int newname) rename_id((ID *)obedit->data, "CurveCircle"); } if(cutype==CU_BEZIER) { + nu->flag= CU_2D; nu->pntsu= 4; nu->bezt= callocstructN(BezTriple, 4, "addNurbprim1"); nu->flagu= CU_CYCLIC; @@ -5077,7 +5075,7 @@ Nurb *add_nurbs_primitive(bContext *C, int type, int newname) } /* always do: */ - nu->flag= CU_SMOOTH; + nu->flag |= CU_SMOOTH; test2DNurb(nu); diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index d226834bc21..9ef250d7963 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -406,11 +406,11 @@ void OBJECT_OT_mesh_add(wmOperatorType *ot) } static EnumPropertyItem prop_curve_types[] = { - {CU_BEZIER|CU_2D|CU_PRIM_CURVE, "BEZIER_CURVE", ICON_CURVE_BEZCURVE, "Bezier Curve", ""}, - {CU_BEZIER|CU_2D|CU_PRIM_CIRCLE, "BEZIER_CIRCLE", ICON_CURVE_BEZCIRCLE, "Bezier Circle", ""}, - {CU_NURBS|CU_2D|CU_PRIM_CURVE, "NURBS_CURVE", ICON_CURVE_NCURVE, "NURBS Curve", ""}, - {CU_NURBS|CU_2D|CU_PRIM_CIRCLE, "NURBS_CIRCLE", ICON_CURVE_NCIRCLE, "NURBS Circle", ""}, - {CU_NURBS|CU_2D|CU_PRIM_PATH, "PATH", ICON_CURVE_PATH, "Path", ""}, + {CU_BEZIER|CU_PRIM_CURVE, "BEZIER_CURVE", ICON_CURVE_BEZCURVE, "Bezier Curve", ""}, + {CU_BEZIER|CU_PRIM_CIRCLE, "BEZIER_CIRCLE", ICON_CURVE_BEZCIRCLE, "Bezier Circle", ""}, + {CU_NURBS|CU_PRIM_CURVE, "NURBS_CURVE", ICON_CURVE_NCURVE, "NURBS Curve", ""}, + {CU_NURBS|CU_PRIM_CIRCLE, "NURBS_CIRCLE", ICON_CURVE_NCIRCLE, "NURBS Circle", ""}, + {CU_NURBS|CU_PRIM_PATH, "PATH", ICON_CURVE_PATH, "Path", ""}, {0, NULL, 0, NULL, NULL} }; @@ -1064,7 +1064,7 @@ static int return_editcurve_indexar(Object *obedit, int *tot, int **indexar, flo int *index, a, nr, totvert=0; for(nu= editnurb->first; nu; nu= nu->next) { - if((nu->type & 7)==CU_BEZIER) { + if(nu->type == CU_BEZIER) { bezt= nu->bezt; a= nu->pntsu; while(a--) { @@ -1091,7 +1091,7 @@ static int return_editcurve_indexar(Object *obedit, int *tot, int **indexar, flo cent[0]= cent[1]= cent[2]= 0.0; for(nu= editnurb->first; nu; nu= nu->next) { - if((nu->type & 7)==CU_BEZIER) { + if(nu->type == CU_BEZIER) { bezt= nu->bezt; a= nu->pntsu; while(a--) { @@ -1200,7 +1200,7 @@ static void select_editcurve_hook(Object *obedit, HookModifierData *hmd) int index=0, a, nr=0; for(nu= editnurb->first; nu; nu= nu->next) { - if((nu->type & 7)==CU_BEZIER) { + if(nu->type == CU_BEZIER) { bezt= nu->bezt; a= nu->pntsu; while(a--) { @@ -2795,7 +2795,7 @@ void make_vertex_parent(Scene *scene, Object *obedit, View3D *v3d) nu= editnurb->first; while(nu) { - if((nu->type & 7)==CU_BEZIER) { + if(nu->type == CU_BEZIER) { bezt= nu->bezt; a= nu->pntsu; while(a--) { @@ -3705,7 +3705,7 @@ static int object_center_set_exec(bContext *C, wmOperator *op) nu= nu1; while(nu) { - if( (nu->type & 7)==CU_BEZIER) { + if(nu->type == CU_BEZIER) { a= nu->pntsu; while (a--) { VecSubf(nu->bezt[a].vec[0], nu->bezt[a].vec[0], cent); @@ -5742,7 +5742,7 @@ static void apply_objects_internal(Scene *scene, View3D *v3d, int apply_scale, i nu= cu->nurb.first; while(nu) { - if( (nu->type & 7)==CU_BEZIER) { + if(nu->type == CU_BEZIER) { a= nu->pntsu; bezt= nu->bezt; while(a--) { diff --git a/source/blender/editors/space_info/info_stats.c b/source/blender/editors/space_info/info_stats.c index 2d14fbc515e..7acebbdb72e 100644 --- a/source/blender/editors/space_info/info_stats.c +++ b/source/blender/editors/space_info/info_stats.c @@ -193,7 +193,7 @@ static void stats_object_edit(Object *obedit, SceneStats *stats) int a; for(nu=cu->editnurb->first; nu; nu=nu->next) { - if((nu->type & 7)==CU_BEZIER) { + if(nu->type == CU_BEZIER) { bezt= nu->bezt; a= nu->pntsu; while(a--) { diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index 3b6ca455b48..220952d190f 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -1392,7 +1392,7 @@ void nurbs_foreachScreenVert(ViewContext *vc, void (*func)(void *userData, Nurb int i; for (nu= cu->editnurb->first; nu; nu=nu->next) { - if((nu->type & 7)==CU_BEZIER) { + if(nu->type == CU_BEZIER) { for (i=0; i<nu->pntsu; i++) { BezTriple *bezt = &nu->bezt[i]; @@ -3888,7 +3888,7 @@ static void tekenhandlesN(Nurb *nu, short sel) glBegin(GL_LINES); - if( (nu->type & 7)==CU_BEZIER) { + if(nu->type == CU_BEZIER) { if(sel) col= nurbcol+4; else col= nurbcol; @@ -3945,7 +3945,7 @@ static void tekenvertsN(Nurb *nu, short sel) bglBegin(GL_POINTS); - if((nu->type & 7)==CU_BEZIER) { + if(nu->type == CU_BEZIER) { bezt= nu->bezt; a= nu->pntsu; @@ -3986,7 +3986,7 @@ static void draw_editnurb(Object *ob, Nurb *nurb, int sel) nu= nurb; while(nu) { if(nu->hide==0) { - switch(nu->type & 7) { + switch(nu->type) { case CU_POLY: cpack(nurbcol[3]); bp= nu->bp; @@ -4094,7 +4094,7 @@ static void drawnurb(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base, /* first non-selected handles */ for(nu=nurb; nu; nu=nu->next) { - if((nu->type & 7)==CU_BEZIER) { + if(nu->type == CU_BEZIER) { tekenhandlesN(nu, 0); } } @@ -4102,7 +4102,7 @@ static void drawnurb(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base, draw_editnurb(ob, nurb, 1); /* selected handles */ for(nu=nurb; nu; nu=nu->next) { - if((nu->type & 7)==1) tekenhandlesN(nu, 1); + if(nu->type == CU_BEZIER) tekenhandlesN(nu, 1); tekenvertsN(nu, 0); } diff --git a/source/blender/editors/space_view3d/view3d_buttons.c b/source/blender/editors/space_view3d/view3d_buttons.c index 39e90a37b3f..2bef37e43e6 100644 --- a/source/blender/editors/space_view3d/view3d_buttons.c +++ b/source/blender/editors/space_view3d/view3d_buttons.c @@ -226,7 +226,7 @@ static void v3d_editvertex_buts(const bContext *C, uiBlock *block, View3D *v3d, nu= cu->editnurb->first; while(nu) { - if((nu->type & 7)==CU_BEZIER) { + if(nu->type == CU_BEZIER) { bezt= nu->bezt; a= nu->pntsu; while(a--) { @@ -409,7 +409,7 @@ static void v3d_editvertex_buts(const bContext *C, uiBlock *block, View3D *v3d, nu= cu->editnurb->first; while(nu) { - if((nu->type & 7)==CU_BEZIER) { + if(nu->type == CU_BEZIER) { bezt= nu->bezt; a= nu->pntsu; while(a--) { diff --git a/source/blender/editors/space_view3d/view3d_snap.c b/source/blender/editors/space_view3d/view3d_snap.c index 73b70ccb532..b4b54cd1d88 100644 --- a/source/blender/editors/space_view3d/view3d_snap.c +++ b/source/blender/editors/space_view3d/view3d_snap.c @@ -302,7 +302,7 @@ static void make_trans_verts(Object *obedit, float *min, float *max, int mode) int totmalloc= 0; for(nu= cu->editnurb->first; nu; nu= nu->next) { - if((nu->type & 7)==CU_BEZIER) + if(nu->type == CU_BEZIER) totmalloc += 3*nu->pntsu; else totmalloc += nu->pntsu*nu->pntsv; @@ -311,7 +311,7 @@ static void make_trans_verts(Object *obedit, float *min, float *max, int mode) nu= cu->editnurb->first; while(nu) { - if((nu->type & 7)==CU_BEZIER) { + if(nu->type == CU_BEZIER) { a= nu->pntsu; bezt= nu->bezt; while(a--) { diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index 3f32b707043..d86eddd0a64 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -1373,7 +1373,7 @@ static void createTransCurveVerts(bContext *C, TransInfo *t) /* count total of vertices, check identical as in 2nd loop for making transdata! */ for(nu= cu->editnurb->first; nu; nu= nu->next) { - if((nu->type & 7)==CU_BEZIER) { + if(nu->type == CU_BEZIER) { for(a=0, bezt= nu->bezt; a<nu->pntsu; a++, bezt++) { if(bezt->hide==0) { if (G.f & G_HIDDENHANDLES) { @@ -1409,7 +1409,7 @@ static void createTransCurveVerts(bContext *C, TransInfo *t) td = t->data; for(nu= cu->editnurb->first; nu; nu= nu->next) { - if((nu->type & 7)==CU_BEZIER) { + if(nu->type == CU_BEZIER) { TransData *head, *tail; head = tail = td; for(a=0, bezt= nu->bezt; a<nu->pntsu; a++, bezt++) { diff --git a/source/blender/editors/transform/transform_manipulator.c b/source/blender/editors/transform/transform_manipulator.c index e4ec43a8f38..9fa20c2d674 100644 --- a/source/blender/editors/transform/transform_manipulator.c +++ b/source/blender/editors/transform/transform_manipulator.c @@ -252,7 +252,7 @@ int calc_manipulator_stats(const bContext *C) nu= cu->editnurb->first; while(nu) { - if((nu->type & 7)==CU_BEZIER) { + if(nu->type == CU_BEZIER) { bezt= nu->bezt; a= nu->pntsu; while(a--) { diff --git a/source/blender/editors/transform/transform_orientations.c b/source/blender/editors/transform/transform_orientations.c index 8f9d6108e37..9416425704f 100644 --- a/source/blender/editors/transform/transform_orientations.c +++ b/source/blender/editors/transform/transform_orientations.c @@ -744,7 +744,7 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3], for (nu = cu->editnurb->first; nu; nu = nu->next) { /* only bezier has a normal */ - if((nu->type & 7) == CU_BEZIER) + if(nu->type == CU_BEZIER) { bezt= nu->bezt; a= nu->pntsu; |