def doExportCamera(self) : info = dict() logger.debug('def doExportCamera') path = setting.cachePathInfo() cameraPath = path['cameraPath'] cameraInfoPath = path['cameraInfoPath'] # timeline timeRange = hook.getShotRange() startFrame = timeRange[0] endFrame = timeRange[1] # get sequencer to export sequencerShot = self.shot logger.debug(' shot name %s' % sequencerShot) if hook.objectExists(sequencerShot) : if not os.path.exists(os.path.dirname(cameraPath)) : os.makedirs(os.path.dirname(cameraPath)) hook.export(sequencerShot, cameraPath) self.ui.exportCam_pushButton.setEnabled(False) info.update({str(sequencerShot): {'startFrame': startFrame, 'endFrame': endFrame}}) self.writeData(cameraInfoPath, info) logger.debug(' Export complete') else : logger.debug(' Camera not exists')
def doExportNonCache(self) : nonCachePath = self.getCachePathInfo(True)['nonCachePath'] listWidget = 'nonCache_listWidget' if self.ui.exportAll_checkBox.isChecked() : items = self.getAllItems(listWidget) else : items = self.getSelectedItems(listWidget) if not os.path.exists(nonCachePath) : os.makedirs(nonCachePath) if items : for i in range(len(items[0])) : text1 = items[0][i] text2 = items[1][i] itemWidget = items[2][i] exportGrp = text2 fileName = text1 # if text2 is self.nonCacheAsset, use text1 as an exportGrp if text2 == self.nonCacheAsset : exportGrp = text1 fileName = text1.replace(':', '') exportFile = '%s/%s.ma' % (nonCachePath, fileName) result = hook.export(exportGrp, exportFile) itemWidget.setIcon(self.okIcon, self.iconSize) logger.debug(result) QtGui.QApplication.processEvents()
def doExportNonCache(self): nonCachePath = self.getCachePathInfo(True)['nonCachePath'] listWidget = 'nonCache_listWidget' if self.ui.exportAll_checkBox.isChecked(): items = self.getAllItems(listWidget) else: items = self.getSelectedItems(listWidget) if not os.path.exists(nonCachePath): os.makedirs(nonCachePath) if items: for i in range(len(items[0])): text1 = items[0][i] text2 = items[1][i] itemWidget = items[2][i] exportGrp = text2 fileName = text1 # if text2 is self.nonCacheAsset, use text1 as an exportGrp if text2 == self.nonCacheAsset: exportGrp = text1 fileName = text1.replace(':', '') exportFile = '%s/%s.ma' % (nonCachePath, fileName) result = hook.export(exportGrp, exportFile) itemWidget.setIcon(self.okIcon, self.iconSize) logger.debug(result) QtGui.QApplication.processEvents()
def doExportCamera(self): info = dict() logger.debug('def doExportCamera') path = setting.cachePathInfo() cameraPath = path['cameraPath'] cameraInfoPath = path['cameraInfoPath'] # timeline timeRange = hook.getShotRange() startFrame = timeRange[0] endFrame = timeRange[1] # get sequencer to export sequencerShot = self.shot logger.debug(' shot name %s' % sequencerShot) if hook.objectExists(sequencerShot): if not os.path.exists(os.path.dirname(cameraPath)): os.makedirs(os.path.dirname(cameraPath)) hook.export(sequencerShot, cameraPath) self.ui.exportCam_pushButton.setEnabled(False) info.update({ str(sequencerShot): { 'startFrame': startFrame, 'endFrame': endFrame } }) self.writeData(cameraInfoPath, info) logger.debug(' Export complete') else: logger.debug(' Camera not exists')
def doExportNonCache(self): nonCacheData = dict() nonCachePath = self.getCachePathInfo(True)['nonCachePath'] nonCacheDataPath = self.getCachePathInfo(True)['nonCacheDataPath'] listWidget = 'nonCache_listWidget' if self.ui.exportAll_checkBox.isChecked(): items = self.getAllItems(listWidget) else: items = self.getSelectedItems(listWidget) if not os.path.exists(nonCachePath): os.makedirs(nonCachePath) if items: for i in range(len(items[0])): text1 = items[0][i] text2 = items[1][i] itemWidget = items[2][i] exportGrp = text2 fileName = text1 # if text2 is self.nonCacheAsset, use text1 as an exportGrp if text2 == self.nonCacheAsset: exportGrp = text1 fileName = text1.replace(':', '') exportFile = '%s/%s.ma' % (nonCachePath, fileName) result = hook.export(exportGrp, exportFile) itemWidget.setIcon(self.okIcon, self.iconSize) # data nonCacheData.update({ str(fileName): { 'exportGrp': str(exportGrp), 'filePath': str(exportFile) } }) logger.debug(result) QtGui.QApplication.processEvents() # write data fileUtils.ymlDumper(nonCacheDataPath, nonCacheData) logger.debug('Write noncache data successfully')
def doExportNonCache(self) : nonCacheData = dict() nonCachePath = self.getCachePathInfo(True)['nonCachePath'] nonCacheDataPath = self.getCachePathInfo(True)['nonCacheDataPath'] listWidget = 'nonCache_listWidget' if self.ui.exportAll_checkBox.isChecked() : items = self.getAllItems(listWidget) else : items = self.getSelectedItems(listWidget) if not os.path.exists(nonCachePath) : os.makedirs(nonCachePath) if items : for i in range(len(items[0])) : text1 = items[0][i] text2 = items[1][i] itemWidget = items[2][i] exportGrp = text2 fileName = text1 # if text2 is self.nonCacheAsset, use text1 as an exportGrp if text2 == self.nonCacheAsset : exportGrp = text1 fileName = text1.replace(':', '') exportFile = '%s/%s.ma' % (nonCachePath, fileName) result = hook.export(exportGrp, exportFile) itemWidget.setIcon(self.okIcon, self.iconSize) # data nonCacheData.update({str(fileName): {'exportGrp': str(exportGrp), 'filePath': str(exportFile)}}) logger.debug(result) QtGui.QApplication.processEvents() # write data fileUtils.ymlDumper(nonCacheDataPath, nonCacheData) logger.debug('Write noncache data successfully')