Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Deadline: Simplify GlobalJobPreLoad logic #2605

Merged
merged 9 commits into from
Feb 18, 2022
37 changes: 0 additions & 37 deletions vendor/deadline/custom/events/OpenPype/OpenPype.param

This file was deleted.

191 changes: 0 additions & 191 deletions vendor/deadline/custom/events/OpenPype/OpenPype.py

This file was deleted.

11 changes: 7 additions & 4 deletions vendor/deadline/custom/plugins/GlobalJobPreLoad.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,23 @@
from Deadline.Scripting import RepositoryUtils, FileUtils


def get_openpype_executable():
"""Return OpenPype Executable from Event Plug-in Settings"""
config = RepositoryUtils.GetPluginConfig("OpenPype")
return config.GetConfigEntryWithDefault("OpenPypeExecutable", "")


def inject_openpype_environment(deadlinePlugin):
""" Pull env vars from OpenPype and push them to rendering process.
Used for correct paths, configuration from OpenPype etc.
"""
job = deadlinePlugin.GetJob()
job = RepositoryUtils.GetJob(job.JobId, True) # invalidates cache

print(">>> Injecting OpenPype environments ...")
try:
print(">>> Getting OpenPype executable ...")
exe_list = job.GetJobExtraInfoKeyValue("openpype_executables")
exe_list = get_openpype_executable()
openpype_app = FileUtils.SearchFileList(exe_list)
if openpype_app == "":
raise RuntimeError(
Expand Down Expand Up @@ -96,7 +101,6 @@ def inject_render_job_id(deadlinePlugin):
"""Inject dependency ids to publish process as env var for validation."""
print(">>> Injecting render job id ...")
job = deadlinePlugin.GetJob()
job = RepositoryUtils.GetJob(job.JobId, True) # invalidates cache

dependency_ids = job.JobDependencyIDs
print(">>> Dependency IDs: {}".format(dependency_ids))
Expand Down Expand Up @@ -183,7 +187,6 @@ def __main__(deadlinePlugin):
print("*** GlobalJobPreload start ...")
print(">>> Getting job ...")
job = deadlinePlugin.GetJob()
job = RepositoryUtils.GetJob(job.JobId, True) # invalidates cache

openpype_render_job = \
job.GetJobEnvironmentKeyValue('OPENPYPE_RENDER_JOB') or '0'
Expand Down