def RB_FEE(self): # if not self.G_RENDER_CORE_TYPE=="gpu": if self.G_RENDER_OS != '0': CLASS_COMMON_UTIL.del_net_use() CLASS_COMMON_UTIL.del_subst() if self.G_ACTION not in ['Analyze', 'Pre']: self.format_log('write fee', 'start') self.G_DEBUG_LOG.info('[BASE.RB_FEE.start.....]') self.G_FEE_PARSER.set('render', 'type', self.G_RENDER_CORE_TYPE) # self.G_FEE_PARSER.set('render','start_time','') # self.G_FEE_PARSER.set('render','end_time','') # self.G_FEE_PARSER.set('render','big_pic','') # self.G_FEE_PARSER.set('render','small_pic','') try: with codecs.open(self.G_FEE_FILE, 'w', 'utf-8') as fee_file: self.G_FEE_PARSER.write(fee_file) except Exception as e: CLASS_COMMON_UTIL.error_exit_log(self.G_DEBUG_LOG, 'Write Fee File Failed', is_exit=False) self.G_DEBUG_LOG.info('[BASE.RB_FEE.end.....]') self.format_log('done', 'end')
def RB_MAP_DRIVE(self): #2 self.format_log('映射盘符', 'start') self.G_DEBUG_LOG.info('[BASE.RB_MAP_DRIVE.start.....]') if self.G_RENDER_OS != '0': #delete all mappings CLASS_COMMON_UTIL.del_net_use() CLASS_COMMON_UTIL.del_subst() #net use b_flag = False if self.G_CG_NAME != 'Max' and 'mnt_map' in self.G_TASK_JSON_DICT[ 'system_info']: map_dict = self.G_TASK_JSON_DICT['system_info']['mnt_map'] for key, value in list(map_dict.items()): value = os.path.normpath(value) map_cmd = 'net use "%s" "%s"' % (key, value) # CLASS_COMMON_UTIL.cmd_python3(map_cmd,my_log=self.G_DEBUG_LOG) CLASS_COMMON_UTIL.cmd(map_cmd, my_log=self.G_DEBUG_LOG) if key.lower() == 'b:': b_flag = True if not b_flag: map_cmd_b = 'net use B: "%s"' % (os.path.normpath( self.G_PLUGIN_PATH)) CLASS_COMMON_UTIL.cmd(map_cmd_b, my_log=self.G_DEBUG_LOG, try_count=3) self.G_DEBUG_LOG.info('[BASE.RB_MAP_DRIVE.end.....]') self.format_log('done', 'end')
def RB_MAP_DRIVE(self): #2 self.format_log('映射盘符', 'start') self.G_DEBUG_LOG.info('[BASE.RB_MAP_DRIVE.start.....]') #check the system drive self.check_disk() #delete all mappings CLASS_COMMON_UTIL.del_net_use() CLASS_COMMON_UTIL.del_subst() #net use b_flag = False if self.G_TASK_JSON_DICT['system_info'].has_key('mnt_map'): map_dict = self.G_TASK_JSON_DICT['system_info']['mnt_map'] for key, value in map_dict.items(): map_cmd = 'net use "%s" "%s"' % (key, value) CLASS_COMMON_UTIL.cmd(map_cmd, my_log=self.G_DEBUG_LOG, try_count=3) if key.lower() == 'b:': b_flag = True if not b_flag: map_cmd_b = 'net use B: "%s"' % (self.G_PLUGIN_PATH) CLASS_COMMON_UTIL.cmd(map_cmd_b, my_log=self.G_DEBUG_LOG, try_count=3) self.G_DEBUG_LOG.info('[BASE.RB_MAP_DRIVE.end.....]') self.format_log('done', 'end')
def RB_POST_PY(self):#8 pre custom self.format_log('渲染完毕执行自定义脚本','start') self.G_DEBUG_LOG.info('[BASE.RB_POST_PY.start.....]') self.G_DEBUG_LOG.info(u'如果以下路径的脚本存在,则会被执行') post_py=os.path.join(self.G_NODE_PY,'CG',self.G_CG_NAME,'function','post.py') self.G_DEBUG_LOG.info(post_py) if os.path.exists(post_py): import post as POST_PY_MODEL POST_PY_MODEL.main() # if not self.G_RENDER_CORE_TYPE=="gpu": CLASS_COMMON_UTIL.del_net_use() CLASS_COMMON_UTIL.del_subst() self.G_DEBUG_LOG.info('[BASE.RB_POST_PY.end.....]') self.format_log('done','end')
def RB_POST_PY(self): #8 pre custom self.format_log('渲染完毕执行自定义脚本', 'start') self.G_DEBUG_LOG.info('[BASE.RB_POST_PY.start.....]') self.G_DEBUG_LOG.info(u'如果以下路径的脚本存在,则会被执行') self.G_DEBUG_LOG.info(self.G_POST_PY) if os.path.exists(self.G_POST_PY): sys.argv = [self.G_USER_ID, self.G_TASK_ID] #execfile(self.G_POST_PY) if self.G_RENDER_OS == 'Linux': os.system('./' + self.G_POST_PY) else: os.system('c:/python27/python.exe ' + self.G_POST_PY) # if not self.G_RENDER_CORE_TYPE=="gpu": CLASS_COMMON_UTIL.del_net_use() CLASS_COMMON_UTIL.del_subst() self.G_DEBUG_LOG.info('[BASE.RB_POST_PY.end.....]') self.format_log('done', 'end')
def RB_MAP_DRIVE(self): #2.chongxie self.format_log('[映射盘符]', '[start]') self.G_DEBUG_LOG.info('[c4d.RB_MAP_DRIVE.start.....]') if self.G_RENDER_OS != '0': #delete all mappings CLASS_COMMON_UTIL.del_net_use() CLASS_COMMON_UTIL.del_subst() #net use b_flag = False if self.G_CG_NAME == 'C4d': map_root = os.path.basename(self.G_INPUT_PROJECT_PATH) print(map_root + '@KANADAmmmmmm') map_dict = os.path.join(self.G_INPUT_PROJECT_PATH) print(map_root + '@@KANADAnnnnnn') map_cmd = 'net use %s: "%s"' % (map_root, map_dict) CLASS_COMMON_UTIL.cmd_python3(map_cmd, my_log=self.G_DEBUG_LOG) # #base RB_MAP_DRIVE # if self.G_CG_NAME != 'Max' and self.G_TASK_JSON_DICT['system_info'].has_key('mnt_map'): # map_dict = self.G_TASK_JSON_DICT['system_info']['mnt_map'] # for key,value in map_dict.items(): # value = os.path.normpath(value) # map_cmd = 'net use "%s" "%s"' % (key,value) # CLASS_COMMON_UTIL.cmd_python3(map_cmd,my_log=self.G_DEBUG_LOG) # if key.lower() == 'b:': # b_flag = True if not b_flag: map_cmd_b = 'net use B: "%s"' % (os.path.normpath( self.G_PLUGIN_PATH)) CLASS_COMMON_UTIL.cmd(map_cmd_b, my_log=self.G_DEBUG_LOG, try_count=3) self.G_DEBUG_LOG.info('[c4d.RB_MAP_DRIVE.end.....]') self.format_log('done', 'end')
def RB_DEL_MAP_DRIVER(self): CLASS_COMMON_UTIL.del_net_use() CLASS_COMMON_UTIL.del_subst()