  | | | How do I get the curveeditorcontrol 's fcurve object | How do I get the curveeditorcontrol 's fcurve object 2005-05-01 - By Guy Rabiller
Back 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 > > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META http-equiv=Content-Type content="text/html; charset=iso-8859 (See http://iso-8859.ora-code.com)-1"> <META content="MSHTML 6.00.2800.1491" name=GENERATOR> <STYLE></STYLE> </HEAD> <BODY> <DIV><FONT face=Arial size=2>Hi Felix,</FONT></DIV> <DIV><FONT face=Arial size=2></FONT> </DIV> <DIV><FONT face=Arial size=2>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 ).</FONT></DIV> <DIV><FONT face=Arial size=2></FONT> </DIV> <DIV><FONT face=Arial size=2>In this case, if you want a profile curve it's very easy, no need to use the CComAPIHandler.</FONT></DIV> <DIV><FONT face=Arial size=2></FONT> </DIV> <DIV><FONT face=Arial size=2>You can add a FCurve this way:</FONT></DIV> <DIV><FONT face=Courier size=2>Parameter oParam( oProp.AddFCurveParameter( L"MyFCurve" ) );<BR>FCurve oFCurve( oParam.GetValue() );</FONT></DIV> <DIV><FONT face=Arial size=2></FONT> </DIV> <DIV><FONT face=Arial size=2>You can edit the Curve directly:<BR><FONT face=Courier>oFCurve.RemoveKeys();<BR>oFCurve.BeginEdit();<BR>oFCurve.AddKey( CTime(1), 100L );<BR>oFCurve.AddKey( CTime(100), 100L );<BR>oFCurve.EndEdit();</FONT></FONT></DIV> <DIV><FONT face=Arial size=2></FONT> </DIV> <DIV><FONT face=Arial size=2>From the Operator you can retrieve the FCurve:</FONT></DIV> <DIV><FONT face=Courier size=2>InputPort InPort( InOp.GetPortAt(0,0,0) ); // If CustomPPG is on Group 0 / Port 0<BR>CustomProperty InPSet( InPort.GetValue() );</FONT></DIV> <DIV><FONT face=Courier size=2>CParameterRefArray oParams( InPSet.GetParameters() );</FONT></DIV> <DIV><FONT face=Courier size=2>FCurve oMyFCurve( Parameter( oParams[0] ).GetValue() ); // If FCurve is your first parameter</FONT></DIV> <DIV><FONT face=Arial size=2></FONT> </DIV> <DIV><FONT face=Arial size=2>Then you can evaluate the FCurve:</FONT></DIV> <DIV><FONT face=Courier size=2>float fValue( oMyFCurve.Eval( 2.0f ) ); // Get Y value at X = 2.0</FONT></DIV> <DIV><FONT face=Arial size=2></FONT> </DIV> <DIV><FONT face=Arial size=2>Does it help ?</FONT></DIV> <DIV><FONT face=Arial size=2>--<BR>guy rabiller | 3d technical director @ LaMaison</FONT></DIV> <DIV><FONT face=Arial size=2><BR> </DIV></FONT> <DIV><FONT face=Arial size=2>-- -- Original Message -- -- </FONT> <DIV><FONT face=Arial size=2>From: "Felix Gebhardt" <</FONT><A href="mailto:gebhardt@(protected)"><FONT face=Arial size=2>gebhardt@(protected)</FONT></A><FONT face=Arial size=2>></FONT></DIV> <DIV><FONT face=Arial size=2>To: <</FONT><A href="mailto:XSI@(protected)"><FONT face=Arial size=2>XSI@(protected)</FONT></A><FONT face=Arial size=2>></FONT></DIV> <DIV><FONT face=Arial size=2>Sent: Saturday, April 30, 2005 9:24 PM</FONT></DIV> <DIV><FONT face=Arial size=2>Subject: Re: [C++ API] How do I get the curveeditorcontrol's fcurve object</FONT></DIV></DIV> <DIV><FONT face=Arial><BR><FONT size=2></FONT></FONT></DIV><FONT face=Arial size=2>> <BR>> Hey Reinhard, how are you doing?<BR>> <BR>> Actually I have this very message in my treasure box of rare <BR>> CComAPIHandler examples. Unfortunately having the returned CValue as an <BR>> ; argument of the CRef constructor like in Andrew Skowronski's reply <BR>> doesn't give me a valid CRef for some reason. Just a master girded with <BR>> ; seven belts of COMwisdom would know why.<BR>> <BR>> But I'm really close. The LogMessage already converts to the correct <BR>> ClassIDName.<BR>> <BR>> Thanks a lot for your help,<BR>> Felix<BR>> <BR>> <BR>> <BR>> Reinhard Claus wrote:<BR>> <BR>> >Hm I had a problem a while ago that might be related to this. I had to deal <BR>> >with point subcomponent selections using the c++ api and had similar <BR>> >problems as you're reporting. <BR>> >It turned out that the SubComponent object isn't yet fully supported by the <BR>> >cppapi, and I had to use the CComApi... wrappers all the way through.<BR>> >Using the Invoke method etc. etc... Bad times.<BR>> ><BR>> >http://www.softimage.com/Community/Xsi/Discuss/Archives/xsi.archive.0409 /msg01636.htm<BR>> ><BR>> >Reinhard<BR>> ><BR>> ---<BR>> Unsubscribe? Mail </FONT><A href="mailto:Majordomo@(protected)"><FONT face=Arial size=2>Majordomo@(protected)</FONT></A><FONT face=Arial size=2> with the following text in body:<BR>> unsubscribe xsi<BR>> <BR>> </FONT></BODY></HTML>
|
|
 |