keyframe interpolation programing

   5246   4   1
User Avatar
Member
9 posts
Joined:
Offline
Hi All!

I´ve some questions about channels. programming for custom keyframe interpolation.

1. Is it possible to write a custom Keyframe interpolation function for a channel segment?
What is the syntax?

2. Is it possible to export animation from character so as it is, I mean not samples but really keyframes, as it was animated by animator? Like a animation clips in Maya. I tried to export with Channel ROP also from Channel editor´s menu and I got just a animation with keyframe in each frame.

3. Isit possible to change a Keyframe interpolation for all keys form the same frame direct on the playbar (Also like in Maya, sorry )

Thank you all in advance! :?:
User Avatar
Staff
2591 posts
Joined: July 2005
Offline
stass3d
Hi All!

1. Is it possible to write a custom Keyframe interpolation function for a channel segment?
What is the syntax?


I can try to answer the first one:

You can write any expression in the hscript expression language.

Simple expressions just use $T or $FF to determine motion, like
sin($T*80)

However, there are local variables for keyframe values ($IV is the value at the beginning of the segment, $OV is the output value, $IT is the the start time, $OT is the end time, $LT is the local time, etc.) So for example, you could emulate the linear() function using
fit($LT, $IT, $OT, $IV, $OV)

Alternatively, you can use the python expression function (pythonexprf) from within an hscript expression to evaluate python. Variables within a double quoted string will be expanded, so you can do something like:
pythonexprf(“float($FF)”)
or
pythonexprf(“hou.frame()”)

Another alternative is to set the evaluation type for a channel to python, in which case you can just write Python for channel evaluation (i.e. reading from some USB input device, or using a socket to read values, etc.)

And lastly (I think), you can write a C++ function which extends the hscript expression language. There are examples of this in the HDK sample code.

I hope this helps.
User Avatar
Member
1145 posts
Joined: July 2005
Offline
2. In chops use a spline chop after fetching the channel that you want to export, then save that out as a .chn or .bclip.
I don't use Maya, so I don't know who it will be imported.

3. No, the keys you see on the playbar act as a dope sheet.
“gravity is not a force, it is a boundary layer”
“everything is coincident”
“Love; the state of suspended anticipation.”
User Avatar
Member
7715 posts
Joined: July 2005
Online
stass3d
2. Is it possible to export animation from character so as it is, I mean not samples but really keyframes, as it was animated by animator?

Scope the channels you want in the Channel View pane. From the Channel View pane tab menu, choose Channels > Export Displayed Channels As…
User Avatar
Member
9 posts
Joined:
Offline
Thank you all!!!!

its very helpfull!
  • Quick Links