SLightly altered rule for the new IpoCurve option "Keep horizontal on

extrema". It now also keeps auto-handles horizontal when the Y coordinate
is exactly identical.

And; made this option default on inserting new curve/keys.
This commit is contained in:
2005-07-11 12:31:15 +00:00
parent 85aca9bba1
commit a17e21dfab
4 changed files with 5 additions and 5 deletions

View File

@@ -2010,7 +2010,7 @@ void calchandleNurb(BezTriple *bezt, BezTriple *prev, BezTriple *next, int mode)
if(mode==2 && next && prev) { // keep horizontal if extrema
float ydiff1= prev->vec[1][1] - bezt->vec[1][1];
float ydiff2= next->vec[1][1] - bezt->vec[1][1];
if( (ydiff1<0.0 && ydiff2<0.0) || (ydiff1>0.0 && ydiff2>0.0) ) {
if( (ydiff1<=0.0 && ydiff2<=0.0) || (ydiff1>=0.0 && ydiff2>=0.0) ) {
bezt->vec[0][1]= bezt->vec[1][1];
}
}
@@ -2024,7 +2024,7 @@ void calchandleNurb(BezTriple *bezt, BezTriple *prev, BezTriple *next, int mode)
if(mode==2 && next && prev) { // keep horizontal if extrema
float ydiff1= prev->vec[1][1] - bezt->vec[1][1];
float ydiff2= next->vec[1][1] - bezt->vec[1][1];
if( (ydiff1<0.0 && ydiff2<0.0) || (ydiff1>0.0 && ydiff2>0.0) ) {
if( (ydiff1<=0.0 && ydiff2<=0.0) || (ydiff1>=0.0 && ydiff2>=0.0) ) {
bezt->vec[2][1]= bezt->vec[1][1];
}
}

View File

@@ -3796,7 +3796,7 @@ void default_curve_ipo(Curve *cu)
icu->blocktype= ID_CU;
icu->adrcode= CU_SPEED;
icu->flag= IPO_VISIBLE+IPO_SELECT;
icu->flag= IPO_VISIBLE|IPO_SELECT|IPO_AUTO_HORIZ;
set_icu_vars(icu);
BLI_addtail( &(cu->ipo->curve), icu);

View File

@@ -1925,7 +1925,7 @@ IpoCurve *get_ipocurve(ID *from, short type, int adrcode, Ipo *useipo)
if(icu==0) {
icu= MEM_callocN(sizeof(IpoCurve), "ipocurve");
icu->flag |= IPO_VISIBLE;
icu->flag |= IPO_VISIBLE|IPO_AUTO_HORIZ;
if (!useipo && G.sipo && G.sipo->pin)
icu->blocktype = G.sipo->blocktype;

View File

@@ -290,7 +290,7 @@ static void default_key_ipo(Key *key)
icu->blocktype= ID_KE;
icu->adrcode= KEY_SPEED;
icu->flag= IPO_VISIBLE+IPO_SELECT;
icu->flag= IPO_VISIBLE|IPO_SELECT|IPO_AUTO_HORIZ;
set_icu_vars(icu);
BLI_addtail( &(key->ipo->curve), icu);