Re: FCurve.AddKey()
| Date : Fri, 31 Aug 2007 20:43:06 +0200 |
| To : XSI(at)Softimage.COM |
| From : "Christopher Crouzet" <christopher.crouzet(at)gmail.com> |
| Subject : Re: FCurve.AddKey() |
Instead, you could use the 'SetKeys' function which works fine.
Here is a quick example:
FCurve fcurve;
param.AddFCurve(siStandardFCurve, fcurve);
LONG nKeys = 2;
CTimeArray timeArray(nKeys);
CDoubleArray valueArray(nKeys);
CLongArray keyInterpArray(nKeys);
CTimeArray leftTanXArray(nKeys);
CDoubleArray leftTanYArray(nKeys);
CTimeArray rightTanXArray(nKeys);
CDoubleArray rightTanYArray(nKeys);
timeArray[0] = 0.0; valueArray[0] = 0.0; keyInterpArray[0] = siDefaultKeyInterpolation;
leftTanXArray[0] = 0.0; leftTanYArray[0] = 0.0; rightTanXArray[0] = 0.3; rightTanYArray[0] = 0.5;
timeArray[1] = 1.0; valueArray[1] = 1.0; keyInterpArray[1] = siDefaultKeyInterpolation;
leftTanXArray[1] = - 0.5; leftTanYArray[1] = 0.0; rightTanXArray[1] = 0.3; rightTanYArray[1] = 0.0;
fcurve.SetKeys(timeArray, valueArray, keyInterpArray, leftTanXArray, leftTanYArray, rightTanXArray, rightTanYArray, false);
param.AddFCurve(siStandardFCurve, fcurve);
LONG nKeys = 2;
CTimeArray timeArray(nKeys);
CDoubleArray valueArray(nKeys);
CLongArray keyInterpArray(nKeys);
CTimeArray leftTanXArray(nKeys);
CDoubleArray leftTanYArray(nKeys);
CTimeArray rightTanXArray(nKeys);
CDoubleArray rightTanYArray(nKeys);
timeArray[0] = 0.0; valueArray[0] = 0.0; keyInterpArray[0] = siDefaultKeyInterpolation;
leftTanXArray[0] = 0.0; leftTanYArray[0] = 0.0; rightTanXArray[0] = 0.3; rightTanYArray[0] = 0.5;
timeArray[1] = 1.0; valueArray[1] = 1.0; keyInterpArray[1] = siDefaultKeyInterpolation;
leftTanXArray[1] = - 0.5; leftTanYArray[1] = 0.0; rightTanXArray[1] = 0.3; rightTanYArray[1] = 0.0;
fcurve.SetKeys(timeArray, valueArray, keyInterpArray, leftTanXArray, leftTanYArray, rightTanXArray, rightTanYArray, false);
On 8/31/07, kim aldis <xsi(at)kim-aldis.co.uk> wrote:
The 0.0f is what gives it away.
> -----Original Message-----
> From: owner-xsi(at)Softimage.COM [mailto:owner-xsi(at)Softimage.COM ] On
> Behalf Of Bernard Lebel
> Sent: 31 August 2007 15:40
> To: XSI(at)Softimage.COM
> Subject: Re: FCurve.AddKey()
>
> Considering you're among the 1% people of this list using the CPP SDK,
> you might want to specify it somehow when posting questions, Alan. :-)
>
> Cheers
> Bernard
>
>
>
> On 8/31/07, Alan Jones <skyphyr(at)gmail.com > wrote:
> > Hi Serguei,
> >
> > The C++ one is declared differently.
> >
> > LONG AddKey ( const CTime & in_frame,
> > const CValue & in_value,
> > siFCurveKeyInterpolation in_interp = siDefaultKeyInterpolation,
> > double in_ltx = DBL_MAX,
> > double in_lty = DBL_MAX,
> > double in_rtx = DBL_MAX,
> > double in_rty = DBL_MAX,
> > double in_tol = DBL_MAX,
> > bool in_okl = false
> > )
> >
> > Cheers,
> >
> > Alan.
> >
> > On 8/31/07, Serguei Kalentchouk < serguei.kalentchouk(at)ubisoft.com>
> wrote:
> > > I'm a bit confused because the AddKey method looks like this:
> > > FCurve.AddKey( [Frame], [Value], [Tolerance], [Overwrite] )
> > > I'm not sure which method you are using?
> > >
> > > -----Original Message-----
> > > From: owner-xsi(at)Softimage.COM [mailto: owner-xsi(at)Softimage.COM] On
> Behalf
> > > Of Alan Jones
> > > Sent: August 31, 2007 6:11 AM
> > > To: xsi(at)Softimage.COM
> > > Subject: FCurve.AddKey()
> > >
> > > Hi All,
> > >
> > > This line is not doing what I expected.
> > >
> > > newCurve.AddKey(0.0f, 0.0f, siDefaultKeyInterpolation, -0.5, 0,
> 0.3,
> > > 0.3);
> > >
> > > I imagined that the left and right handles were just time and value
> > > entries, but given the results I get - it seems not. I get just the
> > > same as if I'd just done newCurve.AddKey(0.0f, 0.0f);
> > >
> > > Thanks for any suggestions.
> > >
> > > Cheers,
> > >
> > > Alan.
> > > ---
> > > Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text
> in
> > > body:
> > > unsubscribe xsi
> > >
> > > ---
> > > Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text
> in body:
> > > unsubscribe xsi
> > >
> > ---
> > Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in
> body:
> > unsubscribe xsi
> >
> ---
> Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in
> body:
> unsubscribe xsi
---
Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
unsubscribe xsi
- References:
- FCurve.AddKey()
- From: "Alan Jones" <skyphyr(at)gmail.com>
- RE: FCurve.AddKey()
- From: "Serguei Kalentchouk" <serguei.kalentchouk(at)ubisoft.com>
- Re: FCurve.AddKey()
- From: "Alan Jones" <skyphyr(at)gmail.com>
- Re: FCurve.AddKey()
- From: "Bernard Lebel" <3dbernard(at)gmail.com>
- RE: FCurve.AddKey()
- From: "kim aldis" <xsi(at)kim-aldis.co.uk>
- FCurve.AddKey()
| DATE: | << | >> | THREAD: | << | >> | INDEX: | Main | Thread |
|---|
- Previous by Date: RE: Constraints
- Next by Date: RE: Constraints
- Previous by Thread: RE: Constraints
- Next by Thread: RE: Constraints
- Index(es):
| Search the XSI List archives here or use the advanced search form to search across mailing lists. Searching help is available. |