I tried the MFnAnimCurve::addKey but it does not produce good results even with smooth tangents, especially when the curve has weighted tangents.
The problem in that case is that the out tangent weight of the key just before the one that is inserted must be adjusted to preserve the curve shape as well as the in tangent weight of the key just following...
So is there is no other way, I will use the MGlobal::executeCommand()...
I could post a suggestion on the Maya8 beta forum...
Thanks Rob
_____________
Antoine Galbrun
Attitude-Studio