diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2010-11-26 20:08:22 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2010-11-26 20:08:22 +0300 |
commit | fb42188c18097e57596c53191cfa923d916dba6c (patch) | |
tree | 17077f1128a540ef52c3dbb35c1d266bcca3e852 /source/blender/editors/curve | |
parent | cfd3b11630161a802233b905f7076899888c6fe3 (diff) |
Update nurb keyindex data when subdividing -- shape key data wouldn't be lost anyway
Diffstat (limited to 'source/blender/editors/curve')
-rw-r--r-- | source/blender/editors/curve/editcurve.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c index 63e5c13a485..b35657cb266 100644 --- a/source/blender/editors/curve/editcurve.c +++ b/source/blender/editors/curve/editcurve.c @@ -2597,7 +2597,7 @@ void CURVE_OT_select_inverse(wmOperatorType *ot) static void subdividenurb(Object *obedit, int number_cuts) { Curve *cu= obedit->data; - ListBase *editnurb= curve_get_editcurve(obedit); + EditNurb *editnurb= cu->editnurb; Nurb *nu; BezTriple *prevbezt, *bezt, *beztnew, *beztn; BPoint *bp, *prevbp, *bpnew, *bpn; @@ -2607,7 +2607,7 @@ static void subdividenurb(Object *obedit, int number_cuts) // printf("*** subdivideNurb: entering subdivide\n"); - for(nu= editnurb->first; nu; nu= nu->next) { + for(nu= editnurb->nurbs.first; nu; nu= nu->next) { amount= 0; if(nu->type == CU_BEZIER) { /* @@ -2649,6 +2649,7 @@ static void subdividenurb(Object *obedit, int number_cuts) } while(a--) { memcpy(beztn, prevbezt, sizeof(BezTriple)); + keyIndex_updateBezt(editnurb, prevbezt, beztn, 1, 1); beztn++; if( BEZSELECTED_HIDDENHANDLES(cu, prevbezt) && BEZSELECTED_HIDDENHANDLES(cu, bezt) ) { @@ -2691,7 +2692,10 @@ static void subdividenurb(Object *obedit, int number_cuts) bezt++; } /* last point */ - if((nu->flagu & CU_NURB_CYCLIC)==0) memcpy(beztn, prevbezt, sizeof(BezTriple)); + if((nu->flagu & CU_NURB_CYCLIC)==0) { + memcpy(beztn, prevbezt, sizeof(BezTriple)); + keyIndex_updateBezt(editnurb, prevbezt, beztn, 1, 1); + } MEM_freeN(nu->bezt); nu->bezt= beztnew; @@ -2742,6 +2746,7 @@ static void subdividenurb(Object *obedit, int number_cuts) } while(a--) { memcpy(bpn, prevbp, sizeof(BPoint)); + keyIndex_updateBP(editnurb, prevbp, bpn, 1, 1); bpn++; if( (bp->f1 & SELECT) && (prevbp->f1 & SELECT) ) { @@ -2758,7 +2763,10 @@ static void subdividenurb(Object *obedit, int number_cuts) prevbp= bp; bp++; } - if((nu->flagu & CU_NURB_CYCLIC)==0) memcpy(bpn, prevbp, sizeof(BPoint)); /* last point */ + if((nu->flagu & CU_NURB_CYCLIC)==0) { /* last point */ + memcpy(bpn, prevbp, sizeof(BPoint)); + keyIndex_updateBP(editnurb, prevbp, bpn, 1, 1); + } MEM_freeN(nu->bp); nu->bp= bpnew; @@ -2845,6 +2853,7 @@ static void subdividenurb(Object *obedit, int number_cuts) for(a=0; a<nu->pntsv; a++) { for(b=0; b<nu->pntsu; b++) { *bpn= *bp; + keyIndex_updateBP(editnurb, bp, bpn, 1, 1); bpn++; bp++; if(b<nu->pntsu-1) { @@ -2901,6 +2910,7 @@ static void subdividenurb(Object *obedit, int number_cuts) for(a=0; a<nu->pntsv; a++) { for(b=0; b<nu->pntsu; b++) { *bpn= *bp; + keyIndex_updateBP(editnurb, bp, bpn, 1, 1); bpn++; bp++; } @@ -2947,6 +2957,7 @@ static void subdividenurb(Object *obedit, int number_cuts) for(a=0; a<nu->pntsv; a++) { for(b=0; b<nu->pntsu; b++) { *bpn= *bp; + keyIndex_updateBP(editnurb, bp, bpn, 1, 1); bpn++; bp++; if( (b<nu->pntsu-1) && usel[b]==nu->pntsv && usel[b+1]==nu->pntsv ) { |