Maya/Python: selecting keys with API

Happy New Year Everyone,

I’m brand new to maya/python/api scripting. I’m working on some animation curve tools and I’m trying to figure out how to find the index of a selected key. I can ‘find’ the curve, but not the selected key and it’s index.

Also, is there a similar api function to the mel ‘scaleKey’ command? Or do you have to iterate through each key to do the scaling operation?

Pointers/help greatly appreciated,
Lucas

Do you have a particular need to do it with the API? cmds.keyframe and cmds.scaleKey are the same as the mel versions.

If you have an mObject for your curve, you can get an MFnAnimCurve for it an use the methods there to manipulate the curve.