Message 1 of 5
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I tried "addKeysWithTangents" to set a number of keyframes at once.
It create keyframes with right values at right frames.
But, it cannt make right tangents, all tangents are being generated as "fixed".
import maya.OpenMayaAnim as oma
# mplug : find a MPlug
fnAnim = oma.MFnAnimCurve(mplug)
# create array to set keyframes
for time, value, inTangent, ... in all_my_data:
timeArray.append( time )
valueArray.append( value )
tangentInTypeArray.append( inTangent )
...
fnAnim.addKeysWithTangents(timeArray, valueArray, oma.MFnAnimCurve.kTangentGlobal, oma.MFnAnimCurve.kTangentGlobal, tangentInTypeArray, tangentOutTypeArray, tangentInXArray, tangentInYArray, tangentOutXArray, tangentOutYArray, tangentsLockedArray, weightsLockedArray)
Do you have any other examples of using the API correctly? I would like to know the proper way to use it.
Solved! Go to Solution.