Merge branch 'develop' into feature/pyblish-ftrack

This commit is contained in:
Milan Kolar 2018-11-26 15:48:06 +01:00
commit 72c71c3b0f
5 changed files with 40 additions and 16 deletions

View file

@ -132,9 +132,14 @@ class SubmitDependentImageSequenceJobDeadline(pyblish.api.InstancePlugin):
def process(self, instance):
AVALON_DEADLINE = api.Session.get("AVALON_DEADLINE",
"http://localhost:8082")
assert AVALON_DEADLINE, "Requires AVALON_DEADLINE"
# AVALON_DEADLINE = api.Session.get("AVALON_DEADLINE",
# "http://localhost:8082")
# assert AVALON_DEADLINE, "Requires AVALON_DEADLINE"
try:
deadline_url = os.environ["DEADLINE_REST_URL"]
except KeyError:
self.log.error("Deadline REST API url not found.")
# Get a submission job
job = instance.data.get("deadlineSubmissionJob")
@ -305,7 +310,7 @@ class SubmitDependentImageSequenceJobDeadline(pyblish.api.InstancePlugin):
self.log.info("Submitting..")
self.log.info(json.dumps(payload, indent=4, sort_keys=True))
url = "{}/api/jobs".format(AVALON_DEADLINE)
url = "{}/api/jobs".format(deadline_url)
response = requests.post(url, json=payload)
if not response.ok:
raise Exception(response.text)

View file

@ -20,8 +20,12 @@ class CreateRenderGlobals(avalon.maya.Creator):
self.data["id"] = "avalon.renderglobals"
# get pools
AVALON_DEADLINE = api.Session["AVALON_DEADLINE"]
argument = "{}/api/pools?NamesOnly=true".format(AVALON_DEADLINE)
try:
deadline_url = os.environ["DEADLINE_REST_URL"]
except KeyError:
self.log.error("Deadline REST API url not found.")
argument = "{}/api/pools?NamesOnly=true".format(deadline_url)
response = requests.get(argument)
if not response.ok:
self.log.warning("No pools retrieved")

View file

@ -92,7 +92,7 @@ class MayaSubmitDeadline(pyblish.api.InstancePlugin):
"""Submit available render layers to Deadline
Renders are submitted to a Deadline Web Service as
supplied via the environment variable AVALON_DEADLINE
supplied via the environment variable DEADLINE_REST_URL
"""
@ -103,9 +103,14 @@ class MayaSubmitDeadline(pyblish.api.InstancePlugin):
def process(self, instance):
AVALON_DEADLINE = api.Session.get("AVALON_DEADLINE",
"http://localhost:8082")
assert AVALON_DEADLINE, "Requires AVALON_DEADLINE"
try:
deadline_url = os.environ["DEADLINE_REST_URL"]
except KeyError:
self.log.error("Deadline REST API url not found.")
# AVALON_DEADLINE = api.Session.get("AVALON_DEADLINE",
# "http://localhost:8082")
# assert AVALON_DEADLINE, "Requires AVALON_DEADLINE"
context = instance.context
workspace = context.data["workspaceDir"]
@ -240,7 +245,7 @@ class MayaSubmitDeadline(pyblish.api.InstancePlugin):
self.log.info(json.dumps(payload, indent=4, sort_keys=True))
# E.g. http://192.168.0.1:8082/api/jobs
url = "{}/api/jobs".format(AVALON_DEADLINE)
url = "{}/api/jobs".format(deadline_url)
response = requests.post(url, json=payload)
if not response.ok:
raise Exception(response.text)

View file

@ -1,4 +1,5 @@
import pyblish.api
import os
import avalon.api as api
from avalon.vendor import requests
@ -14,14 +15,19 @@ class ValidateDeadlineConnection(pyblish.api.ContextPlugin):
def process(self, instance):
AVALON_DEADLINE = api.Session.get("AVALON_DEADLINE",
"http://localhost:8082")
# AVALON_DEADLINE = api.Session.get("AVALON_DEADLINE",
# "http://localhost:8082")
#
# assert AVALON_DEADLINE is not None, "Requires AVALON_DEADLINE"
assert AVALON_DEADLINE is not None, "Requires AVALON_DEADLINE"
try:
deadline_url = os.environ["DEADLINE_REST_URL"]
except KeyError:
self.log.error("Deadline REST API url not found.")
# Check response
response = requests.get(AVALON_DEADLINE)
response = requests.get(deadline_url)
assert response.ok, "Response must be ok"
assert response.text.startswith("Deadline Web Service "), (
"Web service did not respond with 'Deadline Web Service'"
)
)

View file

@ -59,6 +59,10 @@ class ValidateYetiRenderScriptCallbacks(pyblish.api.InstancePlugin):
pre_render_callback = cmds.getAttr("defaultRenderGlobals.preMel")
post_render_callback = cmds.getAttr("defaultRenderGlobals.postMel")
if (pre_render_callback is None) or (post_render_callback is None):
# no callbacks returned
return False
pre_callbacks = pre_render_callback.split(";")
post_callbacks = post_render_callback.split(";")