diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-01-04 11:00:16 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-01-04 11:00:16 +0300 |
commit | a735629fd17edd9c0919789dddabee71012fa6a5 (patch) | |
tree | df1600cc3b5133df7ad4c202996a4d7f308a9652 /source/blender/editors/curve | |
parent | f71ff8639cecba62c0477790eea8159d6d75e3c5 (diff) |
no need to define betz in editcurve.c, replace ob_get_key with inline check for anim filter code.
Diffstat (limited to 'source/blender/editors/curve')
-rw-r--r-- | source/blender/editors/curve/editcurve.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c index 488ec71dde0..5dbff672db9 100644 --- a/source/blender/editors/curve/editcurve.c +++ b/source/blender/editors/curve/editcurve.c @@ -3928,7 +3928,6 @@ static int make_segment_exec(bContext *C, wmOperator *op) Curve *cu= obedit->data; ListBase *nubase= curve_get_editcurve(obedit); Nurb *nu, *nu1=0, *nu2=0; - BezTriple *bezt = NULL; BPoint *bp; float *fp, offset; int a, ok= 0; @@ -3960,12 +3959,10 @@ static int make_segment_exec(bContext *C, wmOperator *op) for(nu= nubase->first; nu; nu= nu->next) { if((nu->flagu & CU_NURB_CYCLIC)==0) { /* not cyclic */ if(nu->type == CU_BEZIER) { - bezt= nu->bezt; if(nu1==0) { - if( BEZSELECTED_HIDDENHANDLES(cu, bezt) ) nu1= nu; + if( BEZSELECTED_HIDDENHANDLES(cu, nu->bezt) ) nu1= nu; else { - bezt= bezt+(nu->pntsu-1); - if( BEZSELECTED_HIDDENHANDLES(cu, bezt) ) { + if( BEZSELECTED_HIDDENHANDLES(cu, &(nu->bezt[nu->pntsu-1])) ) { nu1= nu; switchdirectionNurb(nu); keyData_switchDirectionNurb(cu, nu); @@ -3973,14 +3970,13 @@ static int make_segment_exec(bContext *C, wmOperator *op) } } else if(nu2==0) { - if( BEZSELECTED_HIDDENHANDLES(cu, bezt) ) { + if( BEZSELECTED_HIDDENHANDLES(cu, nu->bezt) ) { nu2= nu; switchdirectionNurb(nu); keyData_switchDirectionNurb(cu, nu); } else { - bezt= bezt+(nu->pntsu-1); - if( BEZSELECTED_HIDDENHANDLES(cu, bezt) ) { + if( BEZSELECTED_HIDDENHANDLES(cu, &(nu->bezt[nu->pntsu-1])) ) { nu2= nu; } } @@ -4021,7 +4017,7 @@ static int make_segment_exec(bContext *C, wmOperator *op) if((nu1 && nu2) && (nu1!=nu2)) { if( nu1->type==nu2->type) { if(nu1->type == CU_BEZIER) { - bezt = + BezTriple *bezt = (BezTriple*)MEM_mallocN((nu1->pntsu+nu2->pntsu) * sizeof(BezTriple), "addsegmentN"); ED_curve_beztcpy(cu->editnurb, bezt, nu2->bezt, nu2->pntsu); ED_curve_beztcpy(cu->editnurb, bezt+nu2->pntsu, nu1->bezt, nu1->pntsu); |