Exemple #1
0
    def readPreset(self) : 
        data = None 

        if not os.path.exists(self.presetPath) : 
            data = {'Default': [], 'Examples': ['clean']}

            fileUtils.checkDir(self.presetPath)
            fileUtils.ymlDumper(self.presetPath, data)

        else : 
            data = fileUtils.ymlLoader(self.presetPath)

        return data
    def readPreset(self):
        data = None

        if not os.path.exists(self.presetPath):
            data = {'Default': [], 'Examples': ['clean']}

            fileUtils.checkDir(self.presetPath)
            fileUtils.ymlDumper(self.presetPath, data)

        else:
            data = fileUtils.ymlLoader(self.presetPath)

        return data
Exemple #3
0
    def doPublish(self) : 
        cmds = self.getAllExeList()
        save = self.ui.save_checkBox.isChecked()
        output = str(self.ui.output_lineEdit.text())
        batch = self.ui.batch_checkBox.isChecked()

        if not batch : 

            # run cmd 
            for cmd in cmds : 
                print 'run %s' % cmd
                self.setOutputLog('run %s' % cmd)

                try : 
                    # eval(setting.cmdList[cmd])
                    cmd = 'rigCmd.%s()' % cmd
                    eval(cmd)
                    print '-> OK'
                    self.setOutputLog('-> OK')

                except Exception as e : 
                    print '-> error %s' % e
                    self.setOutputLog('-> error %s' % e)

            if save : 
                fileUtils.checkDir(output)
                mc.file(rename = output)
                mc.file(save = True, type = 'mayaAscii', f = True)
                self.setOutputLog('Saved %s' % output)

                self.outputFile = output

        else : 
            self.setOutputLog('Run batch')
            src = self.asset.thisScene()
            dst = output
            rigBatch.run(src, dst, str(cmds))
            self.setOutputLog('Run batch complete')

        self.savePresetToDefault()
        self.listExeList()
    def doPublish(self):
        cmds = self.getAllExeList()
        save = self.ui.save_checkBox.isChecked()
        output = str(self.ui.output_lineEdit.text())
        batch = self.ui.batch_checkBox.isChecked()

        if not batch:

            # run cmd
            for cmd in cmds:
                print 'run %s' % cmd
                self.setOutputLog('run %s' % cmd)

                try:
                    # eval(setting.cmdList[cmd])
                    cmd = 'rigCmd.%s()' % cmd
                    eval(cmd)
                    print '-> OK'
                    self.setOutputLog('-> OK')

                except Exception as e:
                    print '-> error %s' % e
                    self.setOutputLog('-> error %s' % e)

            if save:
                fileUtils.checkDir(output)
                mc.file(rename=output)
                mc.file(save=True, type='mayaAscii', f=True)
                self.setOutputLog('Saved %s' % output)

                self.outputFile = output

        else:
            self.setOutputLog('Run batch')
            src = self.asset.thisScene()
            dst = output
            rigBatch.run(src, dst, str(cmds))
            self.setOutputLog('Run batch complete')

        self.savePresetToDefault()
        self.listExeList()