def upload(self): btpVfxProject.SetProjName(self.ui.label_Project.text()) versionStr = btpVfxProject.TimeMark() vfxMayaOp.UnlockNode(self.rootNode) vfxMayaOp.UnlockAttr(self.rootNode, "version") vfxMayaOp.SetAttr_Str(self.rootNode, "version", versionStr) vfxMayaOp.LockAttr(self.rootNode, "version") vfxMayaOp.LockNode(self.rootNode) globalTaskPath = btpVfxProject.AttachRootPath( self.ui.label_Project.text(), self.ui.label_task.text()) CopyMayaTex.CopyAndRepathTextureFiles("%s/texture" % globalTaskPath, self.ui.progressBar_texFiles) maFile = "%s/%s" % (globalTaskPath, self.ui.label_taskFile.text()) vfxMayaOp.SaveMaFile(maFile) self.ui.progressBar_taskFiles.setValue(10) projInfo = btpVfxProject.ProjInfo() previewFile = "%s/%s_preview.mov" % (globalTaskPath, self.rootNode) mayaMakePreview.makePreview(previewFile, "%s_Cam" % self.rootNode, True, 100, 100, 1, 100, (projInfo["resW"], projInfo["resH"]), 1) self.ui.progressBar_taskFiles.setValue(20) btpVfxProject.SaveVersion( projName=self.ui.label_Project.text(), taskPath=self.ui.label_task.text(), files=[maFile, self.imagePathName, previewFile], comment=self.ui.textEdit_comment.toHtml(), timeMark=versionStr, progressBar=self.ui.progressBar_taskFiles) self.accept()
def OpenProj(self): dial=btpOpenProjectDial() rootPath=btpVfxProject.RootPath() dial.ListProj(rootPath) if dial.exec_(): btpVfxProject.SetProjName(dial.CurrentProj()) self.ui.dataTreeWidget.Update() projInfo=btpVfxProject.ProjInfo() self.ui.label_resX.setText(str(projInfo["resW"])) self.ui.label_resY.setText(str(projInfo["resH"])) self.ui.label_fps.setText(projInfo["fps"])
def upload(self): btpVfxProject.SetProjName(self.ui.label_Project.text()) versionStr = btpVfxProject.TimeMark() taskNode = hou.node("/obj/%s" % self.rootNode) taskNode.setParms({"version": versionStr}) globalTaskPath = btpVfxProject.AttachRootPath( self.ui.label_Project.text(), self.ui.label_task.text()) hipFile = "%s/%s" % (globalTaskPath, self.ui.label_taskFile.text()) hou.hipFile.save(hipFile) self.ui.progressBar_taskFiles.setValue(10) projInfo = btpVfxProject.ProjInfo() globalTaskPreviewName = "%s/%s_preview" % (globalTaskPath, self.rootNode) previewFile = "%s.$F4.jpg" % globalTaskPreviewName scene = toolutils.sceneViewer() flipbook_options = scene.flipbookSettings().stash() frameRange = (self.ui.spinBox_startFrame.value(), self.ui.spinBox_endFrame.value()) flipbook_options.useResolution(True) flipbook_options.resolution((projInfo["resW"], projInfo["resH"])) flipbook_options.frameRange(frameRange) flipbook_options.output(previewFile) viewport = scene.curViewport() viewport.setCamera(hou.node("/obj/%s_Cam" % self.rootNode)) scene.flipbook(viewport, flipbook_options) previewFile_jpgSeq = "%s.####.jpg" % globalTaskPreviewName previewFile_mov = "%s.mov" % globalTaskPreviewName btpVfxProject.JpgToMov(previewFile_jpgSeq, previewFile_mov, frameRange, "Nobody", self.ui.label_task.text(), versionStr) btpVfxProject.DeleteFiles("%s.????.jpg" % globalTaskPreviewName) self.ui.progressBar_taskFiles.setValue(20) btpVfxProject.SaveVersion( projName=self.ui.label_Project.text(), taskPath=self.ui.label_task.text(), files=[hipFile, self.imagePathName, previewFile_mov], comment=self.ui.textEdit_comment.toHtml(), timeMark=versionStr, progressBar=self.ui.progressBar_taskFiles) self.accept()
def InitTask(self, taskPathName, projData): obj = hou.node("/obj") taskGrpName = btpVfxProject.TaskNodeNameByTaskPathName(taskPathName) taskNode = obj.createNode("geo", node_name=taskGrpName) fileObj = hou.node("/obj/%s/file1" % taskGrpName) fileObj.destroy() taskNode.addSpareParmTuple( hou.StringParmTemplate("taskPath", "taskPath", 1)) taskNode.addSpareParmTuple( hou.StringParmTemplate("version", "version", 1)) taskNode.addSpareParmTuple( hou.StringParmTemplate("projName", "projName", 1)) taskNode.setParms({ "taskPath": taskPathName, "projName": btpVfxProject.ProjName(), "version": "0" }) projInfo = btpVfxProject.ProjInfo() hou.setFps({"film": 24, "ntsc": 30, "pal": 25}[projInfo["fps"]]) taskCamNode = obj.createNode("cam", node_name="%s_Cam" % taskGrpName) taskCamNode.setParms({ "resx": float(projInfo["resW"]), "resy": float(projInfo["resH"]) })
def InitTask(self): self.dccOp.InitTask(self.taskPathName,btpVfxProject.ProjInfo())