Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Time laps
- from pymel.core import *
- import shutil as s
- import time
- global onOff
- onOff = 0
- def takePicture(fileName):
- tmpDirectory = (os.path.expanduser("~/Documents/maya/projects/default/images/tmp/timeLaps.iff"))
- filePath = (os.path.expanduser("~/Desktop/"+fileName+".iff"))
- hwRender(cam="camera1", cf=1, fnp = 1)
- s.copy2(tmpDirectory, filePath)
- def startTimeLaps(*args):
- global onOff
- onOff = 1
- print "Start Time Laps"
- start = time.clock()
- i = 0
- while onOff:
- refresh(cw=1)
- elapsed = (time.clock() - start)
- #print elapsed
- if elapsed > 1:
- rotate("camera_grp", 0,1,0,os=1,r=1)
- takePicture("hellsheYeat_{0}".format(i))
- start = time.clock()
- i += 1
- print "takingPiutre", i
- def endTimeLaps(*args):
- global onOff
- onOff = 0
- print "Time Laps Stopped"
- window = window(t="Time Laps")
- layout = frameLayout(l = "Time Laps")
- startTLbtn = button(l = "Start")
- stopTLbtn = button(l = "Stop")
- startTLbtn.setCommand(startTimeLaps)
- stopTLbtn.setCommand(endTimeLaps)
- showWindow( window )
Advertisement
Add Comment
Please, Sign In to add comment