[Pymel] animCurve.AddKeys()

Hi All,

I’m having some issues with the addKeys functionality of an animCurve.

it requires addKeys(time, value) and for the life of me figure out what it’s expecting for time.

Error: ‘int’ object is not iterable

Traceback (most recent call last):

File “<maya console>”, line 1, in <module>

File "C:\Program Files\Autodesk\Maya2011\Python\lib\site-packages\pymel\core

odetypes.py", line 2880, in addKeys

for frame in time: times.append(_api.MTime(frame,unit))

TypeError: ‘int’ object is not iterable

I’ve looked into a little and know that MTime() is usually built with [frame, fps unit type] and I’ve tried inputting [30, 30] for time with no success.

Basically, if anyone has a run down on how to properly use animCurve.addKeys() that would be super helpful.

Thanks in advance!

If i remember correctly, addKeys needs iterable types for time and value, so


anim_curve.addKeys((10,),(12,))

or something to that effect

Awesome, thanks! It pointed to another issue, which that I need to update to the latest version of the Pymel API for it to work correctly now.