diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-04-20 19:06:46 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-04-20 19:06:46 +0400 |
commit | 874c29cea8e6f9bc411fccf2d6f4cb07e94328d0 (patch) | |
tree | 5971e577cf7c02e05a1e37b5ad058c71a6744877 /source/blender/editors/curve/editcurve.c | |
parent | 7555bfa793a2b0fc187c6211c56986f35b2d7b09 (diff) | |
parent | c5bc4e4fb1a33eda8c31f2ea02e91f32f74c8fa5 (diff) |
2.50: svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r19323:HEAD
Notes:
* blenderbuttons and ICON_SNAP_PEEL_OBJECT were not merged.
Diffstat (limited to 'source/blender/editors/curve/editcurve.c')
-rw-r--r-- | source/blender/editors/curve/editcurve.c | 78 |
1 files changed, 39 insertions, 39 deletions
diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c index 8c9a282d4ef..72806a79c50 100644 --- a/source/blender/editors/curve/editcurve.c +++ b/source/blender/editors/curve/editcurve.c @@ -652,7 +652,7 @@ static int deleteflagNurb(bContext *C, wmOperator *op, int flag) nu->bp= newbp; clamp_nurb_order_v(nu); - makeknots(nu, 2, nu->flagv>>1); + makeknots(nu, 2); } else { /* is the nurb in V direction selected */ @@ -698,7 +698,7 @@ static int deleteflagNurb(bContext *C, wmOperator *op, int flag) nu->pntsu= newu; clamp_nurb_order_u(nu); } - makeknots(nu, 1, nu->flagu>>1); + makeknots(nu, 1); } } } @@ -746,7 +746,7 @@ static short extrudeflagNurb(ListBase *editnurb, int flag) nu->pntsv= 2; nu->orderv= 2; - makeknots(nu, 2, nu->flagv>>1); + makeknots(nu, 2); } } else { @@ -789,7 +789,7 @@ static short extrudeflagNurb(ListBase *editnurb, int flag) MEM_freeN(nu->bp); nu->bp= newbp; nu->pntsv++; - makeknots(nu, 2, nu->flagv>>1); + makeknots(nu, 2); } else if(v==0 || v== nu->pntsu-1) { /* collumn in v-direction selected */ ok= 1; @@ -816,7 +816,7 @@ static short extrudeflagNurb(ListBase *editnurb, int flag) MEM_freeN(nu->bp); nu->bp= newbp; nu->pntsu++; - makeknots(nu, 1, nu->flagu>>1); + makeknots(nu, 1); } } } @@ -911,7 +911,7 @@ static void adduplicateflagNurb(Object *obedit, short flag) /* knots */ newnu->knotsu= NULL; - makeknots(newnu, 1, newnu->flagu>>1); + makeknots(newnu, 1); } bp++; } @@ -975,14 +975,14 @@ static void adduplicateflagNurb(Object *obedit, short flag) if(nu->pntsu==newnu->pntsu && nu->knotsu) { newnu->knotsu= MEM_dupallocN( nu->knotsu ); } else { - makeknots(newnu, 1, newnu->flagu>>1); + makeknots(newnu, 1); } } if (check_valid_nurb_v(newnu)) { if(nu->pntsv==newnu->pntsv && nu->knotsv) { newnu->knotsv= MEM_dupallocN( nu->knotsv ); } else { - makeknots(newnu, 2, newnu->flagv>>1); + makeknots(newnu, 2); } } } @@ -1962,8 +1962,8 @@ static int subdivide_exec(bContext *C, wmOperator *op) nu->bp= bpnew; nu->pntsu+= amount; - if(nu->type & 4) { - makeknots(nu, 1, nu->flagu>>1); + if(nu->type & CU_NURBS) { + makeknots(nu, 1); } } } /* End of 'else if(nu->pntsv==1)' */ @@ -2074,8 +2074,8 @@ static int subdivide_exec(bContext *C, wmOperator *op) nu->bp= bpnew; nu->pntsu= 2*nu->pntsu-1; nu->pntsv= 2*nu->pntsv-1; - makeknots(nu, 1, nu->flagu>>1); - makeknots(nu, 2, nu->flagv>>1); + makeknots(nu, 1); + makeknots(nu, 2); } /* End of 'if(sel== nu->pntsu*nu->pntsv)' (subdivide entire NURB) */ else { /* subdivide in v direction? */ @@ -2118,7 +2118,7 @@ static int subdivide_exec(bContext *C, wmOperator *op) MEM_freeN(nu->bp); nu->bp= bpnew; nu->pntsv+= sel; - makeknots(nu, 2, nu->flagv>>1); + makeknots(nu, 2); } else { /* or in u direction? */ @@ -2158,7 +2158,7 @@ static int subdivide_exec(bContext *C, wmOperator *op) MEM_freeN(nu->bp); nu->bp= bpnew; nu->pntsu+= sel; - makeknots(nu, 1, nu->flagu>>1); /* shift knots + makeknots(nu, 1); /* shift knots forward */ } } @@ -2316,7 +2316,7 @@ static int convertspline(short type, Nurb *nu) BPoint *bp; int a, c, nr; - if((nu->type & 7)==0) { /* Poly */ + if((nu->type & 7)==CU_POLY) { if(type==CU_BEZIER) { /* to Bezier with vecthandles */ nr= nu->pntsu; bezt = @@ -2337,16 +2337,16 @@ static int convertspline(short type, Nurb *nu) nu->bp= 0; nu->pntsu= nr; nu->type &= ~7; - nu->type |= 1; + nu->type |= CU_BEZIER; calchandlesNurb(nu); } else if(type==CU_NURBS) { nu->type &= ~7; - nu->type+= 4; + nu->type |= CU_NURBS; nu->orderu= 4; nu->flagu &= CU_CYCLIC; /* disable all flags except for cyclic */ nu->flagu += 4; - makeknots(nu, 1, nu->flagu>>1); + makeknots(nu, 1); a= nu->pntsu*nu->pntsv; bp= nu->bp; while(a--) { @@ -2400,7 +2400,7 @@ static int convertspline(short type, Nurb *nu) if(type== 4) { nu->flagu &= CU_CYCLIC; /* disable all flags except for cyclic */ nu->flagu += 4; - makeknots(nu, 1, nu->flagu>>1); + makeknots(nu, 1); } } } @@ -2442,7 +2442,7 @@ static int convertspline(short type, Nurb *nu) nu->knotsu= NULL; nu->pntsu= nr; nu->type &= ~7; - nu->type+= 1; + nu->type |= CU_BEZIER; } } } @@ -2803,12 +2803,12 @@ static void merge_2_nurb(wmOperator *op, ListBase *editnurb, Nurb *nu1, Nurb *nu } } - if((nu1->type & 7)==4) { + if((nu1->type & 7)==CU_NURBS) { /* merge knots */ - makeknots(nu1, 1, nu1->flagu>>1); + makeknots(nu1, 1); /* make knots, for merged curved for example */ - makeknots(nu1, 2, nu1->flagv>>1); + makeknots(nu1, 2); } MEM_freeN(temp); @@ -2991,9 +2991,9 @@ static int make_segment_exec(bContext *C, wmOperator *op) BLI_remlink(editnurb, nu2); /* now join the knots */ - if((nu1->type & 7)==4) { + if((nu1->type & 7)==CU_NURBS) { if(nu1->knotsu==NULL) { - makeknots(nu1, 1, nu1->flagu>>1); + makeknots(nu1, 1); } else { fp= MEM_mallocN(sizeof(float)*KNOTSU(nu1), "addsegment3"); @@ -3216,7 +3216,7 @@ static int spin_nurb(bContext *C, Scene *scene, Object *obedit, float *dvec, sho if(isNurbsel(nu)) { nu->orderv= 4; nu->flagv |= CU_CYCLIC; - makeknots(nu, 2, nu->flagv>>1); + makeknots(nu, 2); } } } @@ -3352,7 +3352,7 @@ static int addvert_Nurb(bContext *C, short mode, float location[3]) if(bp) { nu->pntsu++; - makeknots(nu, 1, nu->flagu>>1); + makeknots(nu, 1); if(mode=='e') { VECCOPY(newbp->vec, bp->vec); @@ -3492,7 +3492,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)==0 ) { + if( (nu->type & 7)==CU_POLY ) { a= nu->pntsu; bp= nu->bp; while(a--) { @@ -3522,7 +3522,7 @@ static int toggle_cyclic_exec(bContext *C, wmOperator *op) while(a--) { if( bp->f1 & SELECT ) { nu->flagu ^= CU_CYCLIC; - makeknots(nu, 1, nu->flagu>>1); /* 1==u type is ignored for cyclic curves */ + makeknots(nu, 1); /* 1==u type is ignored for cyclic curves */ break; } bp++; @@ -3537,11 +3537,11 @@ static int toggle_cyclic_exec(bContext *C, wmOperator *op) if( bp->f1 & SELECT) { if(direction==0 && nu->pntsu>1) { nu->flagu ^= CU_CYCLIC; - makeknots(nu, 1, nu->flagu>>1); /* 1==u type is ignored for cyclic curves */ + makeknots(nu, 1); /* 1==u type is ignored for cyclic curves */ } if(direction==1 && nu->pntsv>1) { nu->flagv ^= CU_CYCLIC; - makeknots(nu, 2, nu->flagv>>1); /* 2==v type is ignored for cyclic curves */ + makeknots(nu, 2); /* 2==v type is ignored for cyclic curves */ } break; } @@ -4349,7 +4349,7 @@ static int delete_exec(bContext *C, wmOperator *op) clamp_nurb_order_u(nu); }*/ } - makeknots(nu, 1, nu->flagu>>1); + makeknots(nu, 1); } nu= next; } @@ -4810,7 +4810,7 @@ Nurb *add_nurbs_primitive(bContext *C, int type, int newname) if(cutype==CU_NURBS) { nu->knotsu= 0; /* makeknots allocates */ - makeknots(nu, 1, nu->flagu>>1); + makeknots(nu, 1); } } @@ -4845,7 +4845,7 @@ Nurb *add_nurbs_primitive(bContext *C, int type, int newname) if(cutype==CU_NURBS) { nu->knotsu= 0; /* makeknots allocates */ - makeknots(nu, 1, nu->flagu>>1); + makeknots(nu, 1); } break; @@ -4930,7 +4930,7 @@ Nurb *add_nurbs_primitive(bContext *C, int type, int newname) bp++; } - makeknots(nu, 1, nu->flagu>>1); + makeknots(nu, 1); } break; case CU_PRIM_PATCH: /* 4x4 patch */ @@ -4967,8 +4967,8 @@ Nurb *add_nurbs_primitive(bContext *C, int type, int newname) } } - makeknots(nu, 1, nu->flagu>>1); - makeknots(nu, 2, nu->flagv>>1); + makeknots(nu, 1); + makeknots(nu, 2); } break; case CU_PRIM_TUBE: /* tube */ @@ -5030,7 +5030,7 @@ Nurb *add_nurbs_primitive(bContext *C, int type, int newname) bp++; } nu->flagu= 4; - makeknots(nu, 1, nu->flagu>>1); + makeknots(nu, 1); BLI_addtail(editnurb, nu); /* temporal for spin */ if(newname && (U.flag & USER_ADD_VIEWALIGNED) == 0) @@ -5038,7 +5038,7 @@ Nurb *add_nurbs_primitive(bContext *C, int type, int newname) else spin_nurb(C, scene, obedit, 0, 0); - makeknots(nu, 2, nu->flagv>>1); + makeknots(nu, 2); a= nu->pntsu*nu->pntsv; bp= nu->bp; |