How do I get the curveeditorcontrol 's fcurve object 2005-05-01 - By Felix Gebhardt
Back Hey Guy,
Stupid, I tried this with the profile editor on the operator's PPG first and there it fails. Then I got hypnotized by the CComAPIHandler's mystical aura. But yes, works fine now on the external PPG.
Thanks a lot, I'll add an entry on you beer list, (on page 7 now) Felix
Guy Rabiller wrote:
>Hi Felix, > >not sure to fully understand what you are after, on my side I often deal with CustomPPG connected to a Custom Operator ( in place of Parameters directly on the Operator, I put them on CustomPPGs, wich offers more possibilities ). > >In this case, if you want a profile curve it's very easy, no need to use the CComAPIHandler. > >You can add a FCurve this way: >Parameter oParam( oProp.AddFCurveParameter( L"MyFCurve" ) ); >FCurve oFCurve( oParam.GetValue() ); > >You can edit the Curve directly: >oFCurve.RemoveKeys(); >oFCurve.BeginEdit(); >oFCurve.AddKey( CTime(1), 100L ); >oFCurve.AddKey( CTime(100), 100L ); >oFCurve.EndEdit(); > >>From the Operator you can retrieve the FCurve: >InputPort InPort( InOp.GetPortAt(0,0,0) ); // If CustomPPG is on Group 0 / Port 0 >CustomProperty InPSet( InPort.GetValue() ); >CParameterRefArray oParams( InPSet.GetParameters() ); >FCurve oMyFCurve( Parameter( oParams[0] ).GetValue() ); // If FCurve is your first parameter > >Then you can evaluate the FCurve: >float fValue( oMyFCurve.Eval( 2.0f ) ); // Get Y value at X = 2.0 > >Does it help ? >-- >guy rabiller | 3d technical director @ LaMaison > > >-- -- Original Message -- -- >From: "Felix Gebhardt" <gebhardt@(protected)> >To: <XSI@(protected)> >Sent: Saturday, April 30, 2005 9:24 PM >Subject: Re: [C++ API] How do I get the curveeditorcontrol's fcurve object > > > > >>Hey Reinhard, how are you doing? >> >>Actually I have this very message in my treasure box of rare >>CComAPIHandler examples. Unfortunately having the returned CValue as an >>argument of the CRef constructor like in Andrew Skowronski's reply >>doesn't give me a valid CRef for some reason. Just a master girded with >>seven belts of COMwisdom would know why. >> >>But I'm really close. The LogMessage already converts to the correct >>ClassIDName. >> >>Thanks a lot for your help, >>Felix >> >> >> >>Reinhard Claus wrote: >> >> >> >>>Hm I had a problem a while ago that might be related to this. I had to deal >>>with point subcomponent selections using the c++ api and had similar >>>problems as you're reporting. >>>It turned out that the SubComponent object isn't yet fully supported by the >>>cppapi, and I had to use the CComApi... wrappers all the way through. >>>Using the Invoke method etc. etc... Bad times. >>> >>>http://www.softimage.com/Community/Xsi/Discuss/Archives/xsi.archive.0409 /msg01636.htm >>> >>>Reinhard >>> >>> >>> >>--- >>Unsubscribe? Mail Majordomo@(protected) with the following text in body: >>unsubscribe xsi >> >> >> >> --- Unsubscribe? Mail Majordomo@(protected) with the following text in body: unsubscribe xsi
|
|