AnimSys2: Two Bugfixes for IPO Editor
* Fixed the long-standing problem where a selected Beztriple's handles would not be able to be scaled when if one of the handles wasn't moved first. The cause of this was that auto-handles will keep handles clamped in place. To solve this, I've added a special hack, which will result in auto-handles being converted to aligned handles whe rotating/scaling BezTriples that have all its points selected. This should behave more in line with expected behaviour. * Setting per-segment interpolation in curve EditMode was broken. Was a misplaced check that I forgot to move.
This commit is contained in:
@@ -3918,8 +3918,8 @@ void make_ipo_transdata (TransInfo *t)
|
||||
if (icu->ipo == IPO_MIXED) {
|
||||
bezt= icu->bezt;
|
||||
for (b=0; b < icu->totvert; b++, bezt++) {
|
||||
if (bezt->ipo == IPO_BEZ) count += 3;
|
||||
else count ++;
|
||||
if (bezt->ipo == IPO_BEZ) count += 3; // err...
|
||||
else count++;
|
||||
}
|
||||
}
|
||||
else if (icu->ipo == IPO_BEZ)
|
||||
@@ -3967,6 +3967,7 @@ void make_ipo_transdata (TransInfo *t)
|
||||
|
||||
for (b=0; b < icu->totvert; b++, prevbezt=bezt, bezt++) {
|
||||
TransDataCurveHandleFlags *hdata = NULL;
|
||||
short h1=1, h2=1;
|
||||
|
||||
/* only include handles if selected, and interpolaton mode uses beztriples */
|
||||
if ( (!prevbezt && (bezt->ipo==IPO_BEZ)) || (prevbezt && (prevbezt->ipo==IPO_BEZ)) ) {
|
||||
@@ -3974,14 +3975,29 @@ void make_ipo_transdata (TransInfo *t)
|
||||
hdata = initTransDataCurveHandes(td, bezt);
|
||||
bezt_to_transdata(td++, td2d++, bezt->vec[0], bezt->vec[1], 1, onlytime);
|
||||
}
|
||||
else
|
||||
h1= 0;
|
||||
}
|
||||
if (bezt->ipo==IPO_BEZ) {
|
||||
if (bezt->f3 & SELECT) {
|
||||
if (hdata==NULL) {
|
||||
if (hdata==NULL)
|
||||
hdata = initTransDataCurveHandes(td, bezt);
|
||||
}
|
||||
bezt_to_transdata(td++, td2d++, bezt->vec[2], bezt->vec[1], 1, onlytime);
|
||||
}
|
||||
else
|
||||
h2= 0;
|
||||
}
|
||||
|
||||
/* special hack (must be done after initTransDataCurveHandes(), as that stores handle settings to restore...):
|
||||
* - Check if we've got entire BezTriple selected and we're scaling/rotating that point,
|
||||
* then check if we're using auto-handles.
|
||||
* - If so, change them auto-handles to aligned handles so that handles get affected too
|
||||
*/
|
||||
if ((bezt->h1 == HD_AUTO) && (bezt->h2 == HD_AUTO) && ELEM(t->mode, TFM_ROTATION, TFM_RESIZE)) {
|
||||
if ((h1 && h2) && (bezt->f2 & SELECT)) {
|
||||
bezt->h1= HD_ALIGN;
|
||||
bezt->h2= HD_ALIGN;
|
||||
}
|
||||
}
|
||||
|
||||
/* only include main vert if selected */
|
||||
|
@@ -978,12 +978,12 @@ void set_ipotype(short event)
|
||||
|
||||
ei= G.sipo->editipo;
|
||||
for(a=0; a<G.sipo->totipo; a++, ei++) {
|
||||
if (ISPOIN3(ei, flag & IPO_VISIBLE, flag & IPO_SELECT, icu)) {
|
||||
if (ISPOIN(ei, flag & IPO_VISIBLE, icu)) {
|
||||
if (ei->flag & IPO_EDIT) {
|
||||
/* set mode for selected points only */
|
||||
icu_keys_bezier_loop(ei->icu, bezier_function, set_ipocurve_mixed);
|
||||
}
|
||||
else {
|
||||
else if (ei->flag & IPO_SELECT) {
|
||||
/* if curve is not in editmode, set mode for entire curve */
|
||||
set_interpolation_ipocurve(ei->icu, event-1);
|
||||
}
|
||||
|
Reference in New Issue
Block a user