Exemple #1
0
    def accept(self):

        if self.mJobNameEdit.text().isEmpty():
            QMessageBox.critical(self, 'Missing Job Name',
                                 'You must choose a name for this job')
            return

        if not QFile.exists(self.mFileNameEdit.text()):
            QMessageBox.critical(self, 'Invalid File',
                                 'You must choose an existing RealFlow File')
            return

        if not self.checkFrameList():
            QMessageBox.critical(self, 'Invalid Start and End Frame',
                                 'End Frame must be greater then Start Frame')
            return

        self.saveSettings()

        if self.mDeleteFramesBeforeSubmitCheck.isChecked():
            tFileName = str(self.mOutputPathCombo.currentText())
            tFileDelete = os.path.dirname(tFileName) + "/*" + os.path.splitext(
                os.path.basename(tFileName))[1]
            self.__specialDeleteMsg(tFileDelete)
            time.sleep(60)

        submitter = Submitter(self)
        self.connect(submitter, SIGNAL('submitSuccess()'), self.submitSuccess)
        self.connect(submitter, SIGNAL('submitError( const QString & )'),
                     self.submitError)

        submitter.applyArgs(self.buildAbsubmitArgs())
        submitter.submit()
Exemple #2
0
def farmSubmit(userArgs):
    jobArgs = buildSubmitArgs()
    jobArgs.update(userArgs)

    # this is overridden as a "security measure"
    jobArgs['runasSubmitter'] = "true"

    if not jobArgs.has_key("minMemory"):
        jobArgs['minMemory'] = str(
            int(jobArgs["assignmentSlots"]) * 1024 * 512)
    if not jobArgs.has_key("maxMemory"):
        jobArgs['maxMemory'] = str(
            int(jobArgs["assignmentSlots"]) * 1024 * 2048)

    # edit per job
    # argMap['fileName'] = "/tmp/myFile.sh"
    #argMap["outputPath"] = "/tmp/outputFoo..exr"
    #argMap['frameList'] = "1-1"
    #argMap['job'] = "my_batch_job"

    start()
    submitter = Submitter()
    submitter.setExitAppOnFinish(False)
    #QObject.connect( submitter, SIGNAL( 'submitSuccess()' ), submitSuccess )
    QObject.connect(submitter, SIGNAL('submitError( const QString & )'),
                    submitError)
    submitter.applyArgs(jobArgs)
    submitter.submit()
    stop()
    return submitter.job()
Exemple #3
0
def farmSubmit(userArgs):
    jobArgs = buildSubmitArgs()
    jobArgs.update( userArgs )

    # this is overridden as a "security measure"
    jobArgs['runasSubmitter'] = "true"

    if not jobArgs.has_key("minMemory"):
        jobArgs['minMemory'] = str(int(jobArgs["assignmentSlots"]) * 1024 * 512)
    if not jobArgs.has_key("maxMemory"):
        jobArgs['maxMemory'] = str(int(jobArgs["assignmentSlots"]) * 1024 * 2048)

    # edit per job
    # argMap['fileName'] = "/tmp/myFile.sh"
    #argMap["outputPath"] = "/tmp/outputFoo..exr"
    #argMap['frameList'] = "1-1"
    #argMap['job'] = "my_batch_job"

    start()
    submitter = Submitter()
    submitter.setExitAppOnFinish(False)
    #QObject.connect( submitter, SIGNAL( 'submitSuccess()' ), submitSuccess )
    QObject.connect( submitter, SIGNAL( 'submitError( const QString & )' ), submitError )
    submitter.applyArgs( jobArgs )
    submitter.submit()
    stop()
    return submitter.job()
Exemple #4
0
    def accept(self):
        if self.mJobNameEdit.text().isEmpty():
            QMessageBox.critical(self, 'Missing Job Name',
                                 'You must choose a name for this job')
            return

        if not QFile.exists(self.mFileNameEdit.text()):
            QMessageBox.critical(self, 'Invalid File',
                                 'You must choose an existing blend file')
            return

        if not self.checkFrameList():
            QMessageBox.critical(
                self, 'Invalid Frame List',
                'Frame Lists are comma separated lists of either "XXX", or "XXX-YYY"'
            )
            return

        jobArgs = self.buildSubmitArgs()
        jobArgs['job'] = self.mJobNameEdit.text()

        submitter = Submitter(self)
        self.connect(submitter, SIGNAL('submitSuccess()'), self.submitSuccess)
        self.connect(submitter, SIGNAL('submitError( const QString & )'),
                     self.submitError)
        submitter.applyArgs(jobArgs)
        submitter.submit()
Exemple #5
0
	def accept(self):
		if self.mJobNameEdit.text().isEmpty():
			QMessageBox.critical(self, 'Missing Job Name', 'You must choose a name for this job' )
			return
		
		if not QFile.exists( self.mFileNameEdit.text() ):
			QMessageBox.critical(self, 'Invalid File', 'You must choose an existing fusion flow' )
			return
		
		if not self.checkFrameList():
			QMessageBox.critical(self, 'Invalid Frame List', 'Frame Lists are comma separated lists of either "XXX", or "XXX-YYY"' )
			return
		
		self.saveSettings()

		if self.mDeleteFramesBeforeSubmitCheck.isChecked():
##			tFileName = str(self.mOutputPathCombo.currentText())
##			tFileDelete = os.path.dirname(tFileName) + "/*" + os.path.splitext(os.path.basename(tFileName))[1]
##			self.__specialDeleteMsg(tFileDelete)
##			time.sleep(60)
			for loop in (range(self.mOutputPathCombo.count())):
				tFileName = str(self.mOutputPathCombo.itemText(loop))
				tFileDelete = os.path.dirname(tFileName) + "/*" + os.path.splitext(os.path.basename(tFileName))[1]
				self.__specialDeleteMsg(tFileDelete)
			time.sleep(60)				
			
		submitter = Submitter(self)
		self.connect( submitter, SIGNAL( 'submitSuccess()' ), self.submitSuccess )
		self.connect( submitter, SIGNAL( 'submitError( const QString & )' ), self.submitError )
		submitter.applyArgs( self.buildAbsubmitArgs() )
		submitter.submit()
Exemple #6
0
	def accept(self):
		
		if self.mJobNameEdit.text().isEmpty():
			QMessageBox.critical(self, 'Missing Job Name', 'You must choose a name for this job' )
			return
		
		if not QFile.exists( self.mFileNameEdit.text() ):
			QMessageBox.critical(self, 'Invalid File', 'You must choose an existing RealFlow File' )
			return
		
		if not self.checkFrameList():
			QMessageBox.critical(self, 'Invalid Start and End Frame', 'End Frame must be greater then Start Frame' )
			return
		
		self.saveSettings()

		if self.mDeleteFramesBeforeSubmitCheck.isChecked():
			tFileName = str(self.mOutputPathCombo.currentText())
			tFileDelete = os.path.dirname(tFileName) + "/*" + os.path.splitext(os.path.basename(tFileName))[1]
			self.__specialDeleteMsg(tFileDelete)
			time.sleep(60)
			
		submitter = Submitter(self)
		self.connect( submitter, SIGNAL( 'submitSuccess()' ), self.submitSuccess )
		self.connect( submitter, SIGNAL( 'submitError( const QString & )' ), self.submitError )
		
		submitter.applyArgs( self.buildAbsubmitArgs() )
		submitter.submit()
Exemple #7
0
    def accept(self):
        if self.mJobNameEdit.text().isEmpty():
            QMessageBox.critical(self, 'Missing Job Name', 'You must choose a name for this job' )
            return

        if not QFile.exists( self.mFileNameEdit.text() ):
            QMessageBox.critical(self, 'Invalid File', 'You must choose an existing Nuke scene' )
            return

        if not self.checkFrameList():
            QMessageBox.critical(self, 'Invalid Frame List', 'Frame Lists are comma separated lists of either "XXX", or "XXX-YYY"' )
            return

        self.saveSettings()

        if self.mWriteAllCheck.isChecked():
            jobArgs = self.buildSubmitArgs()
            jobArgs['job'] = self.mJobNameEdit.text()
            allOutputs = self.treeWidget.findItems("*", Qt.MatchWildcard)
            index = 1
            for i in allOutputs:
                jobArgs["outputPath"+str(index)] = i.text(1)
                jobArgs["outputPath"] = i.text(1)
                if self.mAllFramesAsSingleTaskCheck.isChecked():
                    jobArgs['frameList'+str(index)] = str('1')
                else:
                    jobArgs['frameList'+str(index)] = str(self.mFrameStartEdit.text() + "-" + self.mFrameEndEdit.text())
                index = index + 1
                outputDir = QFileInfo( jobArgs["outputPath"] ).absolutePath()
                if not os.path.exists( outputDir ):
                    QDir().mkpath( outputDir )

            submitter = Submitter(self)
            self.connect( submitter, SIGNAL( 'submitSuccess()' ), self.submitSuccess )
            self.connect( submitter, SIGNAL( 'submitError( const QString & )' ), self.submitError )
            submitter.applyArgs( jobArgs )
            submitter.submit()
        else:
            selectedItems = self.treeWidget.selectedItems()
            index = 1
            for i in selectedItems:
                jobArgs = self.buildSubmitArgs()
                jobArgs["outputPath"+str(index)] = i.text(1)
                if self.mAllFramesAsSingleTaskCheck.isChecked():
                    jobArgs['frameList'+str(index)] = str('1')
                else:
                    jobArgs['frameList'+str(index)] = str(self.mFrameStartEdit.text() + "-" + self.mFrameEndEdit.text())
                outputDir = QFileInfo( jobArgs["outputPath"+str(index)] ).absolutePath()
                if not os.path.exists( outputDir ):
                    QDir().mkpath( outputDir )
                jobArgs['job'] = self.mJobNameEdit.text() +"_"+ i.text(0)
                jobArgs['append'] = " -X %s" % i.text(0)

                submitter = Submitter(self)
                self.connect( submitter, SIGNAL( 'submitSuccess()' ), self.submitSuccess )
                self.connect( submitter, SIGNAL( 'submitError( const QString & )' ), self.submitError )
                submitter.applyArgs( jobArgs )
                submitter.submit()
Exemple #8
0
	def accept(self):
		if self.mJobNameEdit.text().isEmpty():
			QMessageBox.critical(self, 'Missing Job Name', 'You must choose a name for this job' )
			return
		
		if not QFile.exists( self.mFileNameEdit.text() ):
			QMessageBox.critical(self, 'Invalid File', 'You must choose an existing cinema4d file' )
			return
		
		self.saveSettings()
		
		submitter = Submitter(self)
		self.connect( submitter, SIGNAL( 'submitSuccess()' ), self.submitSuccess )
		self.connect( submitter, SIGNAL( 'submitError( const QString & )' ), self.submitError )
		submitter.applyArgs( self.buildAbsubmitArgList() )
		submitter.submit()
Exemple #9
0
    def accept(self):
        if self.mJobNameEdit.text().isEmpty():
            QMessageBox.critical(self, 'Missing Job Name',
                                 'You must choose a name for this job')
            return

        if not QFile.exists(self.mFileNameEdit.text()):
            QMessageBox.critical(self, 'Invalid File',
                                 'You must choose an existing cinema4d file')
            return

        self.saveSettings()

        submitter = Submitter(self)
        self.connect(submitter, SIGNAL('submitSuccess()'), self.submitSuccess)
        self.connect(submitter, SIGNAL('submitError( const QString & )'),
                     self.submitError)
        submitter.applyArgs(self.buildAbsubmitArgList())
        submitter.submit()
Exemple #10
0
	def accept(self):
		if self.mJobNameEdit.text().isEmpty():
			QMessageBox.critical(self, 'Missing Job Name', 'You must choose a name for this job' )
			return
		
		#if not QFile.exists( self.mSequencePathEdit.text() ):
		#	QMessageBox.critical(self, 'Invalid File', 'You must choose an existing fusion flow' )
		#	return
		
		if not self.checkFrameList():
			QMessageBox.critical(self, 'Invalid Frame List', 'Frame Lists are comma separated lists of either "XXX", or "XXX-YYY"' )
			return
		
		self.saveSettings()

		submitter = Submitter(self)
		self.connect( submitter, SIGNAL( 'submitSuccess()' ), self.submitSuccess )
		self.connect( submitter, SIGNAL( 'submitError( const QString & )' ), self.submitError )
		submitter.applyArgs( self.buildAbsubmitArgs() )
		submitter.submit()
Exemple #11
0
    def accept(self):
        if self.mJobNameEdit.text().isEmpty():
            QMessageBox.critical(self, 'Missing Job Name', 'You must choose a name for this job' )
            return

        if not QFile.exists( self.mFileNameEdit.text() ):
            QMessageBox.critical(self, 'Invalid File', 'You must choose an existing blend file' )
            return

        if not self.checkFrameList():
            QMessageBox.critical(self, 'Invalid Frame List', 'Frame Lists are comma separated lists of either "XXX", or "XXX-YYY"' )
            return
            
        jobArgs = self.buildSubmitArgs()
        jobArgs['job'] = self.mJobNameEdit.text()
        
        submitter = Submitter(self)
        self.connect(submitter,SIGNAL('submitSuccess()'), self.submitSuccess)
        self.connect(submitter,SIGNAL('submitError( const QString & )'), self.submitError)
        submitter.applyArgs(jobArgs)
        submitter.submit()
Exemple #12
0
    def accept(self):
        if self.mJobNameEdit.text().isEmpty():
            QMessageBox.critical(self, 'Missing Job Name',
                                 'You must choose a name for this job')
            return

        if not QFile.exists(self.mFileNameEdit.text()):
            QMessageBox.critical(self, 'Invalid File',
                                 'You must choose an existing fusion flow')
            return

        if not self.checkFrameList():
            QMessageBox.critical(
                self, 'Invalid Frame List',
                'Frame Lists are comma separated lists of either "XXX", or "XXX-YYY"'
            )
            return

        self.saveSettings()

        if self.mDeleteFramesBeforeSubmitCheck.isChecked():
            ##			tFileName = str(self.mOutputPathCombo.currentText())
            ##			tFileDelete = os.path.dirname(tFileName) + "/*" + os.path.splitext(os.path.basename(tFileName))[1]
            ##			self.__specialDeleteMsg(tFileDelete)
            ##			time.sleep(60)
            for loop in (range(self.mOutputPathCombo.count())):
                tFileName = str(self.mOutputPathCombo.itemText(loop))
                tFileDelete = os.path.dirname(
                    tFileName) + "/*" + os.path.splitext(
                        os.path.basename(tFileName))[1]
                self.__specialDeleteMsg(tFileDelete)
            time.sleep(60)

        submitter = Submitter(self)
        self.connect(submitter, SIGNAL('submitSuccess()'), self.submitSuccess)
        self.connect(submitter, SIGNAL('submitError( const QString & )'),
                     self.submitError)
        submitter.applyArgs(self.buildAbsubmitArgs())
        submitter.submit()
Exemple #13
0
    def accept(self):
        if self.mJobNameEdit.text().isEmpty():
            QMessageBox.critical(self, "Missing Job Name", "You must choose a name for this job")
            return

            # if not QFile.exists( self.mSequencePathEdit.text() ):
            # 	QMessageBox.critical(self, 'Invalid File', 'You must choose an existing fusion flow' )
            # 	return

        if not self.checkFrameList():
            QMessageBox.critical(
                self, "Invalid Frame List", 'Frame Lists are comma separated lists of either "XXX", or "XXX-YYY"'
            )
            return

        self.saveSettings()

        submitter = Submitter(self)
        self.connect(submitter, SIGNAL("submitSuccess()"), self.submitSuccess)
        self.connect(submitter, SIGNAL("submitError( const QString & )"), self.submitError)
        submitter.applyArgs(self.buildAbsubmitArgs())
        submitter.submit()
Exemple #14
0
	def accept(self):
		global saveNeeded
		if self.mJobNameEdit.text().isEmpty():
			QMessageBox.critical(self, 'Missing Job Name', 'You must choose a name for this job' )
			return

		if not QFile.exists( self.mFileNameEdit.text() ):
			QMessageBox.critical(self, 'Invalid File', 'You must choose an existing Maya scene' )
			return

		if not self.checkFrameList():
			QMessageBox.critical(self, 'Invalid Frame List', 'Frame Lists are comma separated lists of either "XXX", or "XXX-YYY"' )
			return

		#self.saveSettings()

		melString = str(cmds.getAttr("defaultRenderGlobals.preRenderMel"))
		if melString.find("M2AB") == -1:
			saveNeeded = True
		melString = str(cmds.getAttr("defaultRenderGlobals.postRenderMel"))
		if melString.find("M2AB") == -1:
			saveNeeded = True
		melString = str(cmds.getAttr("defaultRenderGlobals.postMel"))
		if melString.find("M2AB") == -1:
			saveNeeded = True

		cmds.setAttr("defaultRenderGlobals.preRenderMel", 'print(\"M2AB: starting frame\\n\");', type="string")
		cmds.setAttr("defaultRenderGlobals.postRenderMel", 'print(\"M2AB: completed frame\\n\");', type="string")
		cmds.setAttr("defaultRenderGlobals.postMel", 'print(\"M2AB: completed job\\n\");', type="string")

		if saveNeeded:
			cmds.file(save=True)

		renderLayers = cmds.ls(type="renderLayer")
		if len(renderLayers) == 1:
			cmds.setAttr(renderLayers[0] +".renderable", 1)

		for lName in renderLayers:
			if( cmds.getAttr(lName+".renderable") and lName.find(":")==-1 ):
				cmds.editRenderLayerGlobals( currentRenderLayer=lName )

				jobArgs = self.buildSubmitArgs()
				jobArgs.update({})

				if( maya.mel.eval("currentRenderer()") == "mentalRay" ):
					#setCurrentRenderer mentalRay;
					#mentalrayUI "";
					#setAttr mentalrayGlobals.exportVerbosity 5;
					jobArgs['jobType'] = "MentalRay"+version()
					jobArgs['renderer'] = "MentalRay"
				else:
					jobArgs['jobType'] = "Maya"+version()
					jobArgs['renderer'] = "Maya"

				parts = imageNameParts()
				jobArgs["outputPath"] = self.mOutputDirEdit.text() + "/" + parts[0]+".."+parts[2]
				if( lName == "defaultRenderLayer" ):
					jobArgs['job'] = self.mJobNameEdit.text()
				else:
					jobArgs['job'] = self.mJobNameEdit.text() +"_"+lName
				jobArgs["append"] += " -rl "+lName

				submitter = Submitter()
				submitter.applyArgs( jobArgs )
				submitter.submit()