diff options
Diffstat (limited to 'source/blender/editors/curve/editcurve.c')
-rw-r--r-- | source/blender/editors/curve/editcurve.c | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c index 84df77bb120..0a05086a3a4 100644 --- a/source/blender/editors/curve/editcurve.c +++ b/source/blender/editors/curve/editcurve.c @@ -2376,7 +2376,7 @@ static void select_adjacent_cp(ListBase *editnurb, short next, short cont, short BezTriple *bezt; BPoint *bp; int a; - short lastsel= 0, sel=0; + short lastsel= 0; if(next==0) return; @@ -2388,13 +2388,12 @@ static void select_adjacent_cp(ListBase *editnurb, short next, short cont, short if(next < 0) bezt= (nu->bezt + (a-1)); while(a--) { if(a-abs(next) < 0) break; - sel= 0; if((lastsel==0) && (bezt->hide==0) && ((bezt->f2 & SELECT) || (selstatus==0))) { bezt+=next; if(!(bezt->f2 & SELECT) || (selstatus==0)) { - sel= select_beztriple(bezt, selstatus, 1, VISIBLE); + short sel= select_beztriple(bezt, selstatus, 1, VISIBLE); if((sel==1) && (cont==0)) lastsel= 1; - } + } } else { bezt+=next; @@ -2410,11 +2409,10 @@ static void select_adjacent_cp(ListBase *editnurb, short next, short cont, short if(next < 0) bp= (nu->bp + (a-1)); while(a--) { if(a-abs(next) < 0) break; - sel=0; if((lastsel==0) && (bp->hide==0) && ((bp->f1 & SELECT) || (selstatus==0))) { bp+=next; if(!(bp->f1 & SELECT) || (selstatus==0)) { - sel= select_bpoint(bp, selstatus, 1, VISIBLE); + short sel= select_bpoint(bp, selstatus, 1, VISIBLE); if((sel==1) && (cont==0)) lastsel= 1; } } @@ -2443,7 +2441,6 @@ void selectend_nurb(Object *obedit, short selfirst, short doswap, short selstatu BezTriple *bezt; Curve *cu; int a; - short sel; if(obedit==NULL) return; @@ -2451,7 +2448,6 @@ void selectend_nurb(Object *obedit, short selfirst, short doswap, short selstatu cu->lastsel= NULL; for(nu= editnurb->first; nu; nu= nu->next) { - sel= 0; if(nu->type == CU_BEZIER) { a= nu->pntsu; @@ -2464,6 +2460,7 @@ void selectend_nurb(Object *obedit, short selfirst, short doswap, short selstatu } while(a--) { + short sel; if(doswap) sel= swap_selection_beztriple(bezt); else sel= select_beztriple(bezt, selstatus, 1, VISIBLE); @@ -2483,6 +2480,7 @@ void selectend_nurb(Object *obedit, short selfirst, short doswap, short selstatu while(a--) { if (bp->hide == 0) { + short sel; if(doswap) sel= swap_selection_bpoint(bp); else sel= select_bpoint(bp, selstatus, 1, VISIBLE); @@ -5779,6 +5777,7 @@ static int delete_exec(bContext *C, wmOperator *op) clamp_nurb_order_u(nu); }*/ } + clamp_nurb_order_u(nu); nurbs_knot_calc_u(nu); } nu= next; @@ -5927,7 +5926,14 @@ static int delete_exec(bContext *C, wmOperator *op) MEM_freeN(nu1->bp); nu1->bp= bp; nu1->pntsu= a; + nu1->knotsu= NULL; nu->pntsu= cut+1; + + clamp_nurb_order_u(nu); + nurbs_knot_calc_u(nu); + + clamp_nurb_order_u(nu1); + nurbs_knot_calc_u(nu1); } } } @@ -6531,8 +6537,8 @@ Nurb *add_nurbs_primitive(bContext *C, float mat[4][4], int type, int newob) return nu; } -static int curvesurf_prim_add(bContext *C, wmOperator *op, int type, int isSurf) { - +static int curvesurf_prim_add(bContext *C, wmOperator *op, int type, int isSurf) +{ Object *obedit= CTX_data_edit_object(C); ListBase *editnurb; Nurb *nu; @@ -6601,11 +6607,13 @@ static int curvesurf_prim_add(bContext *C, wmOperator *op, int type, int isSurf) return OPERATOR_FINISHED; } -static int curve_prim_add(bContext *C, wmOperator *op, int type) { +static int curve_prim_add(bContext *C, wmOperator *op, int type) +{ return curvesurf_prim_add(C, op, type, 0); } -static int surf_prim_add(bContext *C, wmOperator *op, int type) { +static int surf_prim_add(bContext *C, wmOperator *op, int type) +{ return curvesurf_prim_add(C, op, type, 1); } |