def initUI(self): # self.setMinimumSize(200, 100) self.ui = ui.loadUiWidgetFromPyFile(__file__, parent=self) # layout self.setLayout(QtGui.QVBoxLayout()) self.layout().addWidget(self.ui) self.layout().setSpacing(0) self.layout().setContentsMargins(2, 2, 2, 2) # fill UI info isValid = self.isValidContext() if isValid: self.ui.cb_job.addItem(jobTls.jobName()) self.ui.cb_scene.addItem(jobTls.sceneName()) self.ui.cb_shot.addItem(jobTls.shotName()) self.ui.cb_playblast.addItems(self.getCurrentJobPlayblastPathsShot()) self.ui.cb_colors.addItems(["256", "128", "64", "32", "16", "8"]) self.ui.cb_colors.setCurrentIndex(1) else: self.ui.setEnabled(False) cmds.confirmDialog(t="Alert", message="You must job in a shot to use this tool", button=["OK"], icon="warning") # add signals to the ui elements self.ui.pb_createGIF.clicked.connect(self.createGIF)
def getJob(): """ Return the job from the environment. Returns: (str or None): Job, or None if no job is found. """ return jobTls.jobName()
def getPlayblastPath(): jobName = jobTls.jobName() sceneName = jobTls.sceneName() shotName = jobTls.shotName() if jobName and sceneName and shotName: return ("/jobs/" + jobName + "/" + sceneName + "/" + shotName + "/maya/playblasts/") else: return None
def runPoseLibrary(): """ launches studio library """ superusers = [] # try and read the config file configFilePath = os.path.join("/jobs", _jobTools.jobName(), "config", "animationTools", "poseLibrary", "superusers.conf") if os.path.exists(configFilePath): with open(configFilePath, "r") as f: for line in f.readlines(): superusers.append(line.rstrip()) # launch studio library import studioLibrary if superusers: studioLibrary.main(root="/jobs/ttu/library/studioLibrary", superusers=superusers, lockFolder="approved") else: studioLibrary.main(root="/jobs/ttu/library/studioLibrary")