def inject_openpype_environment(deadlinePlugin): job = deadlinePlugin.GetJob() job = RepositoryUtils.GetJob(job.JobId, True) # invalidates cache print("inject_openpype_environment start") try: exe_list = job.GetJobExtraInfoKeyValue("openpype_executables") openpype_app = FileUtils.SearchFileList(exe_list) if openpype_app == "": raise RuntimeError( "OpenPype executable was not found " + "in the semicolon separated list \"" + exe_list + "\". " + "The path to the render executable can be configured " + "from the Plugin Configuration in the Deadline Monitor.") # tempfile.TemporaryFile cannot be used because of locking export_url = os.path.join(tempfile.gettempdir(), time.strftime('%Y%m%d%H%M%S'), 'env.json') # add HHMMSS + delete later print("export_url {}".format(export_url)) args = [openpype_app, 'extractenvironments', export_url] add_args = {} add_args['project'] = \ job.GetJobEnvironmentKeyValue('AVALON_PROJECT') add_args['asset'] = job.GetJobEnvironmentKeyValue('AVALON_ASSET') add_args['task'] = job.GetJobEnvironmentKeyValue('AVALON_TASK') add_args['app'] = job.GetJobEnvironmentKeyValue('AVALON_APP_NAME') if all(add_args.values()): for key, value in add_args.items(): args.append("--{}".format(key)) args.append(value) else: msg = "Required env vars: AVALON_PROJECT, AVALON_ASSET, " + \ "AVALON_TASK, AVALON_APP_NAME" raise RuntimeError(msg) print("args::{}".format(args)) exit_code = subprocess.call(args, shell=True) if exit_code != 0: raise RuntimeError("Publishing failed, check worker's log") with open(export_url) as fp: contents = json.load(fp) for key, value in contents.items(): deadlinePlugin.SetEnvironmentVariable(key, value) os.remove(export_url) print("inject_openpype_environment end") except Exception: import traceback print(traceback.format_exc()) print("inject_openpype_environment failed") RepositoryUtils.FailJob(job) raise
def RenderExecutable(self): exeList = self.GetConfigEntry("OpenPypeExecutable") exe = FileUtils.SearchFileList(exeList) if exe == "": self.FailRender( "OpenPype executable was not found " + "in the semicolon separated list \"" + exeList + "\". " + "The path to the render executable can be configured " + "from the Plugin Configuration in the Deadline Monitor.") return exe
def RenderExecutable(self): version = self.GetIntegerPluginInfoEntryWithDefault("Version", 18) C4DExeList = self.GetConfigEntry("C4D_" + str(version) + "_RenderExecutable") build = self.GetPluginInfoEntryWithDefault("Build", "None").lower().strip() if SystemUtils.IsRunningOnWindows(): if build == "32bit": self.LogInfo("Enforcing 32 bit build of Cinema 4D") self.C4DExe = FileUtils.SearchFileListFor32Bit(C4DExeList) if self.C4DExe == "": self.LogWarning( "32 bit Cinema 4D " + str(version) + " render executable was not found in the semicolon separated list \"" + C4DExeList + "\". Checking for any executable that exists instead." ) elif build == "64bit": self.LogInfo("Enforcing 64 bit build of Cinema 4D") self.C4DExe = FileUtils.SearchFileListFor64Bit(C4DExeList) if self.C4DExe == "": self.LogWarning( "64 bit Cinema 4D " + str(version) + " render executable was not found in the semicolon separated list \"" + C4DExeList + "\". Checking for any executable that exists instead." ) if self.C4DExe == "": self.LogInfo("Not enforcing a build of Cinema 4D") self.C4DExe = FileUtils.SearchFileList(C4DExeList) if self.C4DExe == "": self.FailRender( "Cinema 4D " + str(version) + " render executable was not found in the semicolon separated list \"" + C4DExeList + "\". The path to the render executable can be configured from the Plugin Configuration in the Deadline Monitor." ) return self.C4DExe
def renderExecutable(self): vrayExeList = self.GetConfigEntry("VRay_RenderExecutable") vrayExe = FileUtils.SearchFileList(vrayExeList) if vrayExe == "": self.FailRender( "V-Ray render executable was not found in the semicolon separated list \"" + vrayExeList + "\". The path to the render executable can be configured from the Plugin Configuration in the Deadline Monitor." ) self.vrayVersion = self.getVrayVersion(vrayExe) return vrayExe
def RenderExecutable(self): version = self.GetPluginInfoEntry("Version") exeList = self.GetConfigEntry("Pype_Executable_" + version.replace(".", "_")) exe = FileUtils.SearchFileList(exeList) if exe == "": self.FailRender( "Pype " + version + " executable was not found " + "in the semicolon separated list \"" + exeList + "\". " + "The path to the render executable can be configured " + "from the Plugin Configuration in the Deadline Monitor.") return exe
def RenderExecutable(self): version = self.GetPluginInfoEntryWithDefault("Version", "4").strip() exe_list = self.GetConfigEntry( "Octane_RenderExecutable{0}".format(version)) exe = FileUtils.SearchFileList(exe_list) if not exe: self.FailRender( 'Octane render executable was not found in the comma-separated list "{0}".' 'The path to the render executable can be configured from the Plugin Configuration in the Deadline Monitor.' .format(exeList)) return exe
def RenderExecutable(self): version = self.GetPluginInfoEntryWithDefault("Version", "2017") sketchUpExeList = self.GetConfigEntry("SketchUp_" + version + "_Executable") sketchUpExe = FileUtils.SearchFileList(sketchUpExeList) if not sketchUpExe: self.FailRender( "SketchUp " + version + " executable was not found in the semicolon separated list \"" + sketchUpExeList + "\". The path to the render executable can be configured from the Plugin Configuration in the Deadline Monitor." ) return sketchUpExe
def render_executable(self): """Get render executable name. Get paths from plugin configuration, find executable and return it. Returns: (str): Render executable. """ oiiotool_exe_list = self.GetConfigEntry("OIIOTool_RenderExecutable") oiiotool_exe = FileUtils.SearchFileList(oiiotool_exe_list) if oiiotool_exe == "": self.FailRender( ("No file found in the semicolon separated " "list \"{}\". The path to the render executable " "can be configured from the Plugin Configuration " "in the Deadline Monitor.").format(oiiotool_exe_list)) return oiiotool_exe
def RenderExecutable(self): version = self.GetPluginInfoEntryWithDefault("Version", "3") renderer = self.GetPluginInfoEntryWithDefault("RenderUsing", "CRender") executableString = "_RenderExecutable_" + version if renderer == "CRender": executableString = "Clarisse" + executableString else: executableString = "CNode" + executableString executableList = self.GetConfigEntry(executableString) executable = FileUtils.SearchFileList(executableList) if executable == "": self.FailRender( renderer + " render executable was not found in the semicolon separated list \"" + executableList + "\". The path to the render executable can be configured from the Plugin Configuration in the Deadline Monitor." ) return executable
def RenderExecutable(self): version = self.GetFloatPluginInfoEntry("Version") if version < 12: aeExeList = self.GetConfigEntry("RenderExecutable" + str(version).replace(".", "_")) elif 13.5 <= version < 14: aeExeList = self.GetConfigEntry("RenderExecutable13_5") else: # For now, we are only supporting the major version of CC aeExeList = self.GetConfigEntry( "RenderExecutable" + str(float(int(version))).replace(".", "_")) aeExe = FileUtils.SearchFileList(aeExeList) if aeExe == "": self.FailRender( "After Effects " + str(version) + " render executable was not found in the semicolon separated list \"" + aeExeList + "\". The path to the render executable can be configured from the Plugin Configuration in the Deadline Monitor." ) return aeExe