diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2011-02-14 20:17:05 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2011-02-14 20:17:05 +0300 |
commit | d7e2607f964b7bff5c8cc2fd9437bdc2815a6f08 (patch) | |
tree | 5c4a42909e21a2b9322a7ce0cecb22c6f2d429b9 /source/blender | |
parent | c66ce21a86be1bf26abc20e5b25139153650c6ba (diff) |
Fix #26082: Fkey in a curve witch was empty before
Stupid error in own previous commit to addvert_Nurb -- empty spline
had been added to spline list.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/curve/editcurve.c | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c index 409fd702844..8f2e7c47c64 100644 --- a/source/blender/editors/curve/editcurve.c +++ b/source/blender/editors/curve/editcurve.c @@ -4405,29 +4405,26 @@ static int addvert_Nurb(bContext *C, short mode, float location[3]) if ((nu == NULL) || (nu->type==CU_BEZIER && bezt==NULL) || (nu->type!=CU_BEZIER && bp==NULL)) { if(mode!='e') { - if(cu->actnu >= 0) nu= BLI_findlink(&editnurb->nurbs, cu->actnu); - else { - /* no selected sement -- create new one which is BEZIER tpye - type couldn't be determined from Curve bt could be changed - in the future, so shouldn't make much headache */ - - nu= MEM_callocN(sizeof(Nurb), "addvert_Nurb nu"); - nu->type= CU_BEZIER; - nu->resolu= cu->resolu; - nu->flag |= CU_SMOOTH; - - BLI_addtail(&editnurb->nurbs, nu); - } + if(cu->actnu >= 0) + nu= BLI_findlink(&editnurb->nurbs, cu->actnu); - if(nu->type==CU_BEZIER) { + if(!nu || nu->type==CU_BEZIER) { newbezt= (BezTriple*)MEM_callocN(sizeof(BezTriple), "addvert_Nurb"); newbezt->radius= 1; newbezt->alfa= 0; BEZ_SEL(newbezt); newbezt->h2= newbezt->h1= HD_AUTO; - newnu= (Nurb*)MEM_mallocN(sizeof(Nurb), "addvert_Nurb newnu"); - memcpy(newnu, nu, sizeof(Nurb)); + newnu= (Nurb*)MEM_callocN(sizeof(Nurb), "addvert_Nurb newnu"); + if(!nu) { + /* no selected sement -- create new one which is BEZIER tpye + type couldn't be determined from Curve bt could be changed + in the future, so shouldn't make much headache */ + newnu->type= CU_BEZIER; + newnu->resolu= cu->resolu; + newnu->flag |= CU_SMOOTH; + } else memcpy(newnu, nu, sizeof(Nurb)); + BLI_addtail(&editnurb->nurbs, newnu); set_actNurb(obedit, newnu); newnu->bezt= newbezt; @@ -4442,6 +4439,7 @@ static int addvert_Nurb(bContext *C, short mode, float location[3]) add_v3_v3v3(newbezt->vec[2], newbezt->vec[1],temp); ok= 1; + nu= newnu; } else if(nu->pntsv == 1) { newbp= (BPoint*)MEM_callocN(sizeof(BPoint), "addvert_Nurb5"); newbp->radius= 1; @@ -4466,6 +4464,7 @@ static int addvert_Nurb(bContext *C, short mode, float location[3]) nurbs_knot_calc_u(newnu); ok= 1; + nu= newnu; } } |