Inside Sabertooth
Learn how Sabertooth uses 3ds Max to create 3D interactive projects, including HBO Go’s Game of Thrones interactive experience
  • 1/3
You are here: Forum Home / Autodesk® Softimage® / XSI SDK / How can I get to the keys of an FCurve IceNode?
  RSS 2.0 ATOM  

How can I get to the keys of an FCurve IceNode?
Rate this thread
 
30179
 
Permlink of this thread  
avatar
  • Location: Copenhagen
  • Total Posts: 50
  • Joined: 22 February 2008 02:47 AM

I’m trying to get the keys of an FCurve IceNode (for exporting) from a script but I am stuck. I can get to the profile parameter, which I suspect holds the fcurve but here is where I get stuck. I can’t seem to find any documentation on this either.

Hope anyone can help here.

Cheers
Jacob



Replies: 0
avatar

sorry.. I found the answer minutes after posting this .. but anyway heres a code snippet for anyone who might have the same problem..

[FONT='Courier New'][COLOR=white]var fCrvNode Selection(0);[/COLOR][/FONT]
[FONT
='Courier New'][COLOR=white] [/COLOR][/FONT]
[FONT
='Courier New'][COLOR=white]Logmessage(fCrvNode.name);[/COLOR][/FONT]
[FONT
='Courier New'][COLOR=white] [/COLOR][/FONT]
[FONT
='Courier New'][COLOR=white]var fCrvProfile fCrvNode .Parameters(0);[/COLOR][/FONT]
[FONT
='Courier New'][COLOR=white]Logmessage(fCrvProfile.Name);[/COLOR][/FONT]
[FONT
='Courier New'][COLOR=white] [/COLOR][/FONT]
[FONT
='Courier New'][COLOR=white]var fCrvFCrv fCrvProfile.Value;[/COLOR][/FONT]
[FONT
='Courier New'][COLOR=white]Logmessage("FCurve Data:");[/COLOR][/FONT]
[FONT
='Courier New'][COLOR=white]Logmessage(" - Number of Keys :" fCrvFCrv.Keys.Count);[/COLOR][/FONT]
[FONT
='Courier New'][COLOR=white]for(i=0;i<fCrvFCrv.Keys.Count;i++)[/COLOR][/FONT]
[FONT
='Courier New'][COLOR=white]{[/COLOR][/FONT]
[FONT
='Courier New'][COLOR=white]    var Key fCrvFCrv.Keys(i);[/COLOR][/FONT]
[FONT
='Courier New'][COLOR=white]    Logmessage("  - Key #" i);[/COLOR][/FONT]
[FONT
='Courier New'][COLOR=white]    Logmessage("  - Left :" Key.Left);[/COLOR][/FONT]
[FONT
='Courier New'][COLOR=white]    Logmessage("  - LeftTanX :" Key.LeftTanX );[/COLOR][/FONT]
[FONT
='Courier New'][COLOR=white]    Logmessage("  - LeftTanY :" Key.LeftTanY );[/COLOR][/FONT]
[FONT
='Courier New'][COLOR=white]    Logmessage("  - Right :" Key.Right );[/COLOR][/FONT]
[FONT
='Courier New'][COLOR=white]    Logmessage("  - RightTanX :" Key.RightTanX );[/COLOR][/FONT]
[FONT
='Courier New'][COLOR=white]    Logmessage("  - RightTanY :" Key.RightTanY );[/COLOR][/FONT]
[FONT
='Courier New'][COLOR=white]    Logmessage("  - Value :" Key.value);[/COLOR][/FONT]
[FONT
='Courier New'][COLOR=white]}[/COLOR][/FONT]


Replies: 0