Tuesday, July 19, 2011

tweenMachine Tangent Error

I recently began receiving reports of a tangent-related error in tweenMachine:

// Error: Unrecognized tangent type. Use spline, clamped, linear, flat or step. //

With the help of one of the guys at work, I determined that this will occur when you're trying to add a tween key outside the range of an attribute's current keyframes; i.e. if you try to add a tween key to an object on frame 105, but the object's first keyframe isn't until frame 110. Because there's no previous key to reference for the tangent type, the tangent type in the script will remain undefined, and Maya will complain when applying the tangent.

I hope to eventually add an elegant solution for this problem. For now, the workaround is just to make sure that all objects that you're trying to tween have keys both before and after the frame where you want the tween key to appear.

2 comments:

Unknown said...

Hey man, first off, LOVE tweenMachine. Use it all the time. I just wanted to chime in that I also get this error when I have non integer frames (i.e. 804.2, etc). If I snap them to integers it works fine but wanted to make sure you were aware.

Hope all is well:)
-Josh

Justin S Barrett said...

Thanks for the heads-up, Josh! I'll be sure to take that situation into account as well when I eventually get around to fixing the problem. Cheers!