I have an animated sphere. Keyframes are between 0 to 10. What command can I use to get the end time of animation? (the 10 value)
Julian Mann
[ Admin ]
Use the keyframe command to get the number of keys and to query the time and value of the last key. Here's the mel:
int $numKeys = `keyframe -query -keyframeCount pSphere1.translateX`;
float $t[] = `keyframe -index ($numKeys -1) -q -tc pSphere1.translateX`;
float $v[] = `keyframe -index ($numKeys -1) -q -vc pSphere1.translateX`;
print ("Last key: Time="+$t[0] +", Value="+ $v[0]+"\n" );
Note, the query flag must come after the index flag.
Hope it helps
