def doExportVrayNodes(self): title = 'Export Vray Nodes' asset = entityInfo.info() returnResult = dict() exportPath = asset.getPath('refData') nodeFile = '%s/%s' % (exportPath, asset.getRefNaming('vrayNode')) dataFile = '%s/%s' % (exportPath, asset.getRefNaming('vrayNodeData')) startMTime1 = None startMTime2 = None currentMTime1 = None currentMTime2 = None if os.path.exists(nodeFile): startMTime1 = os.path.getmtime(nodeFile) if os.path.exists(dataFile): startMTime2 = os.path.getmtime(dataFile) result = pipelineTools.exportVrayNode(dataFile, nodeFile) dataFileResult = result[0] nodeFileResult = result[1] if dataFileResult: currentMTime1 = os.path.getmtime(dataFileResult) if nodeFileResult: currentMTime2 = os.path.getmtime(nodeFileResult) status = False status1 = False status2 = False message = '' if not currentMTime1 == startMTime1: status1 = True message += 'Node file export complete - ' if not currentMTime2 == startMTime2: status2 = True message += 'Node data file export complete' if status1 and status2: status = True if status: self.setStatus(title, True) trace('---- Vray Nodes Output ---') trace(dataFileResult) trace(nodeFileResult)
def doExportVrayNodes(self) : title = 'Export Vray Nodes' asset = entityInfo.info() returnResult = dict() exportPath = asset.getPath('refData') nodeFile = '%s/%s' % (exportPath, asset.getRefNaming('vrayNode')) dataFile = '%s/%s' % (exportPath, asset.getRefNaming('vrayNodeData')) startMTime1 = None startMTime2 = None currentMTime1 = None currentMTime2 = None if os.path.exists(nodeFile) : startMTime1 = os.path.getmtime(nodeFile) if os.path.exists(dataFile) : startMTime2 = os.path.getmtime(dataFile) result = pipelineTools.exportVrayNode(dataFile, nodeFile) dataFileResult = result[0] nodeFileResult = result[1] if dataFileResult : currentMTime1 = os.path.getmtime(dataFileResult) if nodeFileResult : currentMTime2 = os.path.getmtime(nodeFileResult) status = False status1 = False status2 = False message = '' if not currentMTime1 == startMTime1 : status1 = True message += 'Node file export complete - ' if not currentMTime2 == startMTime2 : status2 = True message += 'Node data file export complete' if status1 and status2 : status = True if status : self.setStatus(title, True) trace('---- Vray Nodes Output ---') trace(dataFileResult) trace(nodeFileResult)
def doExportVrayNode(asset, title) : returnResult = dict() exportPath = asset.getPath('refData') nodeFile = '%s/%s' % (exportPath, asset.getRefNaming('vrayNode')) dataFile = '%s/%s' % (exportPath, asset.getRefNaming('vrayNodeData')) startMTime1 = None startMTime2 = None currentMTime1 = None currentMTime2 = None if os.path.exists(nodeFile) : startMTime1 = os.path.getmtime(nodeFile) if os.path.exists(dataFile) : startMTime2 = os.path.getmtime(dataFile) result = pt.exportVrayNode(dataFile, nodeFile) dataFileResult = result[0] nodeFileResult = result[1] if dataFileResult : currentMTime1 = os.path.getmtime(dataFileResult) if nodeFileResult : currentMTime2 = os.path.getmtime(nodeFileResult) status = False status1 = False status2 = False message = '' if not currentMTime1 == startMTime1 : status1 = True message += 'Node file export complete - ' if not currentMTime2 == startMTime2 : status2 = True message += 'Node data file export complete' if status1 and status2 : status = True hero = '%s/%s' % (dataFileResult, nodeFileResult) returnResult.update({title: {'status': status, 'message': message, 'hero': hero}}) return returnResult