diff options
author | Campbell Barton <ideasman42@gmail.com> | 2008-04-04 19:06:50 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2008-04-04 19:06:50 +0400 |
commit | 6b6e5eb4c979e050478baa39d7402c03bcc73c80 (patch) | |
tree | 136c7a02b67516aaad9cd06caa77b301563b5ab7 /source/blender/src/transform_conversions.c | |
parent | eb667866dfde9a227259b0f9bfeaab7fdeaef7ce (diff) |
Restore bezier handles to their original flag if the transform is canceled, for IPO's and curve edit mode.
Also retopo was running of curve transform was canceled.
Diffstat (limited to 'source/blender/src/transform_conversions.c')
-rw-r--r-- | source/blender/src/transform_conversions.c | 38 |
1 files changed, 34 insertions, 4 deletions
diff --git a/source/blender/src/transform_conversions.c b/source/blender/src/transform_conversions.c index 7d9c0242568..a93e43b0f3f 100644 --- a/source/blender/src/transform_conversions.c +++ b/source/blender/src/transform_conversions.c @@ -1281,7 +1281,7 @@ static void createTransCurveVerts(TransInfo *t) Mat3CpyMat4(mtx, G.obedit->obmat); Mat3Inv(smtx, mtx); - + td = t->data; for(nu= editNurb.first; nu; nu= nu->next) { if((nu->type & 7)==CU_BEZIER) { @@ -1289,6 +1289,7 @@ static void createTransCurveVerts(TransInfo *t) head = tail = td; for(a=0, bezt= nu->bezt; a<nu->pntsu; a++, bezt++) { if(bezt->hide==0) { + TransDataCurveHandleFlags *hdata = NULL; if( propmode || ((bezt->f2 & SELECT) && (G.f & G_HIDDENHANDLES)) || @@ -1307,6 +1308,13 @@ static void createTransCurveVerts(TransInfo *t) td->ext = NULL; td->tdi = NULL; td->val = NULL; + + td->flag |= TD_BEZTRIPLE; + hdata = td->misc.hdata = MEM_mallocN(sizeof(TransDataCurveHandleFlags), "CuHandle Data"); + hdata->ih1 = bezt->h1; + hdata->h1 = &bezt->h1; + hdata->ih2 = bezt->h2; /* incase the second is not selected */ + hdata->h2 = &bezt->h2; Mat3CpyMat3(td->smtx, smtx); Mat3CpyMat3(td->mtx, mtx); @@ -1338,7 +1346,18 @@ static void createTransCurveVerts(TransInfo *t) Mat3CpyMat3(td->smtx, smtx); Mat3CpyMat3(td->mtx, mtx); - + + if ((bezt->f1&SELECT)==0 && (bezt->f3&SELECT)==0) + /* If the middle is selected but the sides arnt, this is needed */ + if (hdata==NULL) { /* if the handle was not saved by the previous handle */ + td->flag |= TD_BEZTRIPLE; + hdata = td->misc.hdata = MEM_mallocN(sizeof(TransDataCurveHandleFlags), "CuHandle Data"); + hdata->ih1 = bezt->h1; + hdata->h1 = &bezt->h1; + hdata->ih2 = bezt->h2; /* incase the second is not selected */ + hdata->h2 = &bezt->h2; + } + td++; count++; tail++; @@ -1361,6 +1380,15 @@ static void createTransCurveVerts(TransInfo *t) td->tdi = NULL; td->val = NULL; + if (hdata==NULL) { /* if the handle was not saved by the previous handle */ + td->flag |= TD_BEZTRIPLE; + hdata = td->misc.hdata = MEM_mallocN(sizeof(TransDataCurveHandleFlags), "CuHandle Data"); + hdata->ih1 = bezt->h1; + hdata->h1 = &bezt->h1; + hdata->ih2 = bezt->h2; /* incase the second is not selected */ + hdata->h2 = &bezt->h2; + } + Mat3CpyMat3(td->smtx, smtx); Mat3CpyMat3(td->mtx, mtx); @@ -1376,6 +1404,8 @@ static void createTransCurveVerts(TransInfo *t) } if (propmode && head != tail) calc_distanceCurveVerts(head, tail-1); + + testhandlesNurb(nu); /* sets the handles based on their selection, do this after the data is copied to the TransData */ } else { TransData *head, *tail; @@ -1789,7 +1819,7 @@ static void VertsToTransData(TransData *td, EditVert *eve) td->ext = NULL; td->tdi = NULL; td->val = NULL; - td->tdmir= NULL; + td->misc.tdmir= NULL; if (BIF_GetTransInfo()->mode == TFM_BWEIGHT) { td->val = &(eve->bweight); td->ival = eve->bweight; @@ -2142,7 +2172,7 @@ static void createTransEditVerts(TransInfo *t) /* Mirror? */ if( (mirror>0 && tob->iloc[0]>0.0f) || (mirror<0 && tob->iloc[0]<0.0f)) { EditVert *vmir= editmesh_get_x_mirror_vert(G.obedit, tob->iloc); /* initializes octree on first call */ - if(vmir!=eve) tob->tdmir= vmir; + if(vmir!=eve) tob->misc.tdmir= vmir; } tob++; } |