cwisbg

maya_TimeLaps_v2

Dec 14th, 2012
278
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.11 KB | None | 0 0
  1. # Time laps UI
  2. from pymel.core import *
  3. import shutil as s
  4. import os
  5. def startTimeLaps(*args):
  6.     filePath = (os.path.expanduser("~/Documents/maya/timeLapsTracker.txt"))
  7.     startFile = open(filePath, "w")
  8.     print "Time Laps Started"
  9. def endTimeLaps(*args):
  10.     filePath = (os.path.expanduser("~/Documents/maya/timeLapsTracker.txt"))
  11.     startFile = open(filePath, "w")
  12.     os.remove(filePath)#delete file
  13.     print "Time Laps Stopped"
  14. def portConnect(*args):
  15.     connectionPort = "localhost:6000"
  16.     print "connecting to", connectionPort
  17.     outsideWorld = commandPort(n= connectionPort, stp = "python")
  18.     x = commandPort(connectionPort, q=1)# test Connections
  19.     if x:
  20.         print "Connected Sucsessfully"    
  21. window = window(t="Time Laps", w = 40)
  22. layout = frameLayout(l = "Time Laps")
  23. tlConnect = button(l = "Connect", p = layout)
  24. layout2 = rowColumnLayout( numberOfRows= 2)
  25. startTLbtn = button(l = "Start", p = layout2)
  26. stopTLbtn = button(l = "Stop", p = layout2)
  27. startTLbtn.setCommand(startTimeLaps)
  28. stopTLbtn.setCommand(endTimeLaps)
  29. tlConnect.setCommand(portConnect)
  30. showWindow( window )
Advertisement
Add Comment
Please, Sign In to add comment