I’m new in scripting and I’m trying to code a simple script in maya which gonna grab first and last keyframe of an object and will set it to tangent and set to infinity.
import maya.cmds as cmds
#set first key
cmds.keyTangent(index = (0,0), inTangentType='spline', outTangentType ='spline')
#I was trying to grab last keyframe knowing that in array it will be -1
cmds.keyTangent(index = ([-1]), inTangentType='spline', outTangentType ='spline')
cmds.setInfinity(postInfinite='linear', preInfinite='linear')
I’m specifically looking for a way to grab LAST keyframe, but couldn’t find a way do this online.
New contributor
Filip Gracki is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.