Hey all,
For some reason I can't get this code to work correctly.Please help.
I'm working out of Maya 2009. So when I run this python code I get the
values for the firstKey and lastKey as 0 but if  I just run the last 4
lines of code. I will get something different now,  firstKey=5 and
lastKey=10. I'm not sure what is happening here. I guess my ultimate
goal is to find out what is the first keyframe and lastkeyframe of any
maya scene and be able to set a piece of code in the end like this
------ mc.playbackOptions(aet=lastKey, ast=firstKey)

Thanks Again,
Chris

--------Start New Scene----------

import maya.cmds as mc
#create sphere
mc.polySphere(ch=True,o=True, r=5)

#key sphere in diffrent time
mc.currentTime(5, edit=True )
mc.setKeyframe("pSphere1")
mc.currentTime(10, edit=True )
mc.setAttr("pSphere1.translateY", 5)
mc.setKeyframe("pSphere1")
mc.currentTime(0, edit=True )

#getting first and last key
firstKey = mc.findKeyframe(timeSlider=True, which='first')
lastKey = mc.findKeyframe(timeSlider=True, which='last')
print firstKey
print lastKey

-- 
http://groups.google.com/group/python_inside_maya

Reply via email to