How can I create a dynamic sample rate for increased accuracy in reading from a Maya animation with Python?
Interpolating maya anim curves is not the easiest task in the world (effectively you need to solve the cubic equation to find the correct 't' value to then pass to the cubic interpolation function. It's probably that first step you're missing).
My advice though, would be to simply output samples for the frame values you need from Maya directly, and skip the interpolation entirely (be aware that any transform driven by IK, expressions, etc, will not have anim curves, so you'll get bad data in those cases)
I'm working on a program that outputs data in several CSV files from Maya 2018. It reads an object name from a setting file, then creates an array of every keyframe that object has, then exports a column of keyframes and a column of values of the different axes associated with the object.
This unfortunately causes a problem when using cubic interpolation to connect the dots, so I'm trying to find a better way to collect the data. My current idea is to capture not only the keyframes, but also the frames immediately before and after the keys as well as the midpoints between the keys, but this seems clunky.
Any recommendations?