Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2008-04-04 19:06:50 +0400
committerCampbell Barton <ideasman42@gmail.com>2008-04-04 19:06:50 +0400
commit6b6e5eb4c979e050478baa39d7402c03bcc73c80 (patch)
tree136c7a02b67516aaad9cd06caa77b301563b5ab7 /source/blender/src/editipo.c
parenteb667866dfde9a227259b0f9bfeaab7fdeaef7ce (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/editipo.c')
-rw-r--r--source/blender/src/editipo.c40
1 files changed, 36 insertions, 4 deletions
diff --git a/source/blender/src/editipo.c b/source/blender/src/editipo.c
index fe68e0818bb..c0a6330b9f0 100644
--- a/source/blender/src/editipo.c
+++ b/source/blender/src/editipo.c
@@ -5066,7 +5066,7 @@ static void bezt_to_transdata (TransData *td, TransData2D *td2d, float *loc, flo
td2d->loc[2] = 0.0f;
td2d->loc2d = loc;
- td->flag = 0;
+ /*td->flag = 0;*/ /* can be set beforehand, else make sure its set to 0 */
td->loc = td2d->loc;
VECCOPY(td->center, cent);
VECCOPY(td->iloc, td->loc);
@@ -5077,7 +5077,7 @@ static void bezt_to_transdata (TransData *td, TransData2D *td2d, float *loc, flo
td2d->loc[2] = 0.0f;
td2d->loc2d = loc;
- td->flag = 0;
+ /*td->flag = 0;*/ /* can be set beforehand, else make sure its set to 0 */
td->loc = td2d->loc;
VECCOPY(td->center, cent);
VECCOPY(td->iloc, td->loc);
@@ -5168,19 +5168,51 @@ void make_ipo_transdata (TransInfo *t)
bezt= ei->icu->bezt;
for (b=0; b < ei->icu->totvert; b++, bezt++) {
+ TransDataCurveHandleFlags *hdata = NULL;
/* only include handles if selected, and interpolaton mode uses beztriples */
if (ei->icu->ipo==IPO_BEZ) {
- if (bezt->f1 & SELECT)
+ if (bezt->f1 & SELECT) {
+ 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;
+
bezt_to_transdata(td++, td2d++, bezt->vec[0], bezt->vec[1], 1, onlytime);
- if (bezt->f3 & SELECT)
+ }
+ if (bezt->f3 & SELECT) {
+ if (hdata==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;
+ }
bezt_to_transdata(td++, td2d++, bezt->vec[2], bezt->vec[1], 1, onlytime);
+ }
}
/* only include main vert if selected */
if (bezt->f2 & SELECT) {
+
+ if ((bezt->f1&SELECT)==0 && (bezt->f3&SELECT)==0) {
+ if (hdata==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;
+ }
+ }
+
bezt_to_transdata(td++, td2d++, bezt->vec[1], bezt->vec[1], 1, onlytime);
}
}
+ /* Sets handles based on the selection */
+ testhandles_ipocurve(ei->icu);
}
}
}