def doExportCache(self): logger.debug('def doExportCache') logger.info('--------------------------') logger.info('Start exporting ...') startTime = datetime.now() # get list allStatus = self.ui.exportCacheAll_checkBox.isChecked() # cachePath cachePath = str(self.ui.cache_lineEdit.text()) # asset data path assetDataPath = self.getCachePathInfo(True)['assetDataPath'] listWidget = 'cache_listWidget' assetList = [] itemWidgets = [] # optimized viewport hook.isolateObj(True) if allStatus: items = self.getAllItems(listWidget) assetList = items[1] itemWidgets = items[2] else: items = self.getSelectedItems(listWidget) assetList = items[1] itemWidgets = items[2] if assetList: i = 0 for eachAsset in assetList: if eachAsset in self.assetInfo: # get export group cacheGrp = self.assetInfo[eachAsset]['cacheGrp'] namespace = self.assetInfo[eachAsset]['namespace'] # set status itemWidgets[i].setIcon(self.ipIcon, self.iconSize) QtGui.QApplication.processEvents() # collect time cacheStartTime = datetime.now() # do cache hook.refresh(False) result = abcExport.doExportUICall(namespace, cacheGrp, cachePath) hook.refresh(True) # do export anim curve try: hook.exportAnim(namespace, self.animCurvePath) logger.debug('Export animcurve %s/%s.anim' % (self.animCurvePath, namespace)) except Exception as e: logger.debug('Export Anim curve failed') logger.debug(e) if result: logger.info('Export %s to %s complete' % (cacheGrp, result)) # set status itemWidgets[i].setIcon(self.okIcon, self.iconSize) QtGui.QApplication.processEvents() cacheEndTime = datetime.now() cacheDuration = cacheEndTime - cacheStartTime # collect info self.addAssetLog(namespace, cacheGrp) self.addTimeLog('asset', namespace, cacheDuration) # export asset hierarchy if not os.path.exists(assetDataPath): os.makedirs(assetDataPath) # export asset data dataPath = '%s/%s.yml' % (assetDataPath, namespace) pipelineTools.exportHierarchyData(cacheGrp, dataPath) logger.debug('export asset data %s' % dataPath) i += 1 hook.isolateObj(False) finishTime = datetime.now() duration = finishTime - startTime self.addTimeLog('shot', '', duration) logger.info('Finish export') logger.info('%s' % duration) self.messageBox('Complete', 'Cache complete in %s seconds' % str(duration))
def doExportCache(self) : logger.debug('def doExportCache') logger.info('--------------------------') logger.info('Start exporting ...') startTime = datetime.now() # get list allStatus = self.ui.exportCacheAll_checkBox.isChecked() # cachePath cachePath = str(self.ui.cache_lineEdit.text()) # asset data path assetDataPath = self.getCachePathInfo(True)['assetDataPath'] listWidget = 'cache_listWidget' assetList = [] itemWidgets = [] # optimized viewport hook.isolateObj(True) if allStatus : items = self.getAllItems(listWidget) assetList = items[1] itemWidgets = items[2] else : items = self.getSelectedItems(listWidget) assetList = items[1] itemWidgets = items[2] if assetList : i = 0 for eachAsset in assetList : if eachAsset in self.assetInfo : # get export group cacheGrp = self.assetInfo[eachAsset]['cacheGrp'] namespace = self.assetInfo[eachAsset]['namespace'] # set status itemWidgets[i].setIcon(self.ipIcon, self.iconSize) QtGui.QApplication.processEvents() # collect time cacheStartTime = datetime.now() # do cache hook.refresh(False) result = abcExport.doExportUICall(namespace, cacheGrp, cachePath) hook.refresh(True) # do export anim curve try : hook.exportAnim(namespace, self.animCurvePath) logger.debug('Export animcurve %s/%s.anim' % (self.animCurvePath, namespace)) except Exception as e : logger.debug('Export Anim curve failed') logger.debug(e) if result : logger.info('Export %s to %s complete' % (cacheGrp, result)) # set status itemWidgets[i].setIcon(self.okIcon, self.iconSize) QtGui.QApplication.processEvents() cacheEndTime = datetime.now() cacheDuration = cacheEndTime - cacheStartTime # collect info self.addAssetLog(namespace, cacheGrp) self.addTimeLog('asset', namespace, cacheDuration) # export asset hierarchy if not os.path.exists(assetDataPath) : os.makedirs(assetDataPath) # export asset data dataPath = '%s/%s.yml' % (assetDataPath, namespace) pipelineTools.exportHierarchyData(cacheGrp, dataPath) logger.debug('export asset data %s' % dataPath) i += 1 hook.isolateObj(False) finishTime = datetime.now() duration = finishTime - startTime self.addTimeLog('shot', '', duration) logger.info('Finish export') logger.info('%s' % duration) self.messageBox('Complete', 'Cache complete in %s seconds' % str(duration))
def doExportCache(self) : logger.debug('def doExportCache') logger.info('--------------------------') logger.info('Start exporting ...') startTime = datetime.now() # get list allStatus = self.ui.exportCacheAll_checkBox.isChecked() # cachePath cachePath = str(self.ui.cache_lineEdit.text()) listWidget = 'cache_listWidget' assetList = [] itemWidgets = [] # optimized viewport hook.isolateObj(True) if allStatus : items = self.getAllItems(listWidget) assetList = items[1] itemWidgets = items[2] else : items = self.getSelectedItems(listWidget) assetList = items[1] itemWidgets = items[2] if assetList : i = 0 for eachAsset in assetList : if eachAsset in self.assetInfo : # get export group cacheGrp = self.assetInfo[eachAsset]['cacheGrp'] namespace = self.assetInfo[eachAsset]['namespace'] # set status itemWidgets[i].setIcon(self.ipIcon, self.iconSize) QtGui.QApplication.processEvents() # do cache result = abcExport.doExportUICall(namespace, cacheGrp, cachePath) if result : logger.info('Export %s to %s complete' % (cacheGrp, result)) # set status itemWidgets[i].setIcon(self.okIcon, self.iconSize) QtGui.QApplication.processEvents() i += 1 hook.isolateObj(False) finishTime = datetime.now() duration = finishTime - startTime logger.info('Finish export') logger.info('%s' % duration)
def doExportCache(self): logger.debug('def doExportCache') logger.info('--------------------------') logger.info('Start exporting ...') startTime = datetime.now() # get list allStatus = self.ui.exportCacheAll_checkBox.isChecked() # cachePath cachePath = str(self.ui.cache_lineEdit.text()) listWidget = 'cache_listWidget' assetList = [] itemWidgets = [] # optimized viewport hook.isolateObj(True) if allStatus: items = self.getAllItems(listWidget) assetList = items[1] itemWidgets = items[2] else: items = self.getSelectedItems(listWidget) assetList = items[1] itemWidgets = items[2] if assetList: i = 0 for eachAsset in assetList: if eachAsset in self.assetInfo: # get export group cacheGrp = self.assetInfo[eachAsset]['cacheGrp'] namespace = self.assetInfo[eachAsset]['namespace'] # set status itemWidgets[i].setIcon(self.ipIcon, self.iconSize) QtGui.QApplication.processEvents() # do cache result = abcExport.doExportUICall(namespace, cacheGrp, cachePath) if result: logger.info('Export %s to %s complete' % (cacheGrp, result)) # set status itemWidgets[i].setIcon(self.okIcon, self.iconSize) QtGui.QApplication.processEvents() i += 1 hook.isolateObj(False) finishTime = datetime.now() duration = finishTime - startTime logger.info('Finish export') logger.info('%s' % duration)