Mailing List
Home
Forum Home
Softimage
Carrara
trueSpace
Dir3d-l
Maya - a powerful 3D animation and visual effects software
Macromedia Flash Development
Subjects
Cameras
scaleDown command
black out solved
Aircraft Tutorial
Mathematical XYZ ?
Its done This vs That
Its done first week
recommendations for screen video captures?
3DExplorer "Oddity "
New Director
ProTeam renewals
Fuel 's new websites (X post)
Blue peter create a make toy
targeting groups question
XPost: Shockwave 3D game ( sort of )
RES: RES: RES: Fish Modeling
Emitting particles from object intersection
Fuel 's new websites (X post)
Texturing
Big Break Contest Videos
New Plugins
Models and Texture on my updated site
Error Installing Patch tS6 6
Plasma?
Looking for Inspiration
Weird EMail Q
It 's done first week ?
Cherry not cranberry
New game
Camera Animation Problem
Particle plugins?
 
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
Reply:     1     2     3     4  

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>&nbsp;</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&nbsp;CustomPPGs, wich offers
more possibilities ).</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</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>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>You can add a FCurve this way:</FONT></DIV>
<DIV><FONT face=Courier size=2>Parameter oParam(&nbsp;oProp.AddFCurveParameter(
L"MyFCurve" ) );<BR>FCurve oFCurve( oParam.GetValue() );</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</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),&nbsp;&nbsp; 100L );<BR>oFCurve.AddKey( CTime(100), 100L
);<BR>oFCurve.EndEdit();</FONT></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</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) );
//&nbsp;If CustomPPG is on&nbsp;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(&nbsp;Parameter( oParams[0]
).GetValue() ); // If FCurve is your first parameter</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</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>&nbsp;</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>&nbsp;</DIV></FONT>
<DIV><FONT face=Arial size=2>-- -- Original Message -- -- </FONT>
<DIV><FONT face=Arial size=2>From: "Felix Gebhardt" &lt;</FONT><A
href="mailto:gebhardt@(protected)"><FONT face=Arial
size=2>gebhardt@(protected)</FONT></A><FONT face=Arial
size=2>&gt;</FONT></DIV>
<DIV><FONT face=Arial size=2>To: &lt;</FONT><A
href="mailto:XSI@(protected)"><FONT face=Arial
size=2>XSI@(protected)</FONT></A><FONT face=Arial size=2>&gt;</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>&gt; <BR>&gt; Hey Reinhard, how are you doing?<BR>&gt; <BR>&gt; Actually
I&nbsp; have this very message in my treasure box of rare <BR>&gt;
CComAPIHandler examples. Unfortunately having the returned CValue as an <BR>&gt
;
argument of the CRef constructor like in Andrew Skowronski's reply <BR>&gt;
doesn't give me a valid CRef for some reason. Just a master girded with <BR>&gt
;
seven belts of COMwisdom would know why.<BR>&gt; <BR>&gt; But I'm really close.
The LogMessage already converts to the correct <BR>&gt; ClassIDName.<BR>&gt;
<BR>&gt; Thanks a lot for your help,<BR>&gt; Felix<BR>&gt; <BR>&gt; <BR>&gt;
<BR>&gt; Reinhard Claus wrote:<BR>&gt; <BR>&gt; &gt;Hm I had a problem a while
ago that might be related to this. I had to deal <BR>&gt; &gt;with point
subcomponent selections using the c++ api and had similar <BR>&gt; &gt;problems
as you're reporting. <BR>&gt; &gt;It turned out that the SubComponent object
isn't yet fully supported by the <BR>&gt; &gt;cppapi, and I had to use the
CComApi... wrappers all the way through.<BR>&gt; &gt;Using the Invoke method
etc. etc... Bad times.<BR>&gt; &gt;<BR>&gt;
&gt;http://www.softimage.com/Community/Xsi/Discuss/Archives/xsi.archive.0409
/msg01636.htm<BR>&gt;
&gt;<BR>&gt; &gt;Reinhard<BR>&gt; &gt;<BR>&gt; ---<BR>&gt; 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>&gt; unsubscribe xsi<BR>&gt; <BR>&gt;
</FONT></BODY></HTML>