support for tile render job submitted from elsewhere

This commit is contained in:
Ondrej Samohel 2020-07-28 18:02:59 +02:00
parent b06b3075bf
commit 616817df3e
No known key found for this signature in database
GPG key ID: 8A29C663C672C2B7
3 changed files with 65 additions and 31 deletions

View file

@ -40,6 +40,9 @@ class CreateRender(avalon.maya.Creator):
vrscene (bool): Submit as ``vrscene`` file for standalone V-Ray
renderer.
ass (bool): Submit as ``ass`` file for standalone Arnold renderer.
tileRendering (bool): Instance is set to tile rendering mode. We
won't submit actuall render, but we'll make publish job to wait
for Tile Assemly job done and then publish.
See Also:
https://pype.club/docs/artist_hosts_maya#creating-basic-render-setup
@ -181,6 +184,7 @@ class CreateRender(avalon.maya.Creator):
self.data["machineList"] = ""
self.data["useMayaBatch"] = False
self.data["vrayScene"] = False
self.data["tileRendering"] = False
# Disable for now as this feature is not working yet
# self.data["assScene"] = False
@ -189,8 +193,8 @@ class CreateRender(avalon.maya.Creator):
def _load_credentials(self):
"""Load Muster credentials.
Load Muster credentials from file and set ```MUSTER_USER``,
```MUSTER_PASSWORD``, ``MUSTER_REST_URL`` is loaded from presets.
Load Muster credentials from file and set ``MUSTER_USER``,
``MUSTER_PASSWORD``, ``MUSTER_REST_URL`` is loaded from presets.
Raises:
RuntimeError: If loaded credentials are invalid.

View file

@ -392,18 +392,19 @@ class MayaSubmitDeadline(pyblish.api.InstancePlugin):
self.preflight_check(instance)
# Submit job to farm ------------------------------------------------
self.log.info("Submitting ...")
self.log.debug(json.dumps(payload, indent=4, sort_keys=True))
if not instance.data.get("tileRendering"):
self.log.info("Submitting ...")
self.log.debug(json.dumps(payload, indent=4, sort_keys=True))
# E.g. http://192.168.0.1:8082/api/jobs
url = "{}/api/jobs".format(self._deadline_url)
response = self._requests_post(url, json=payload)
if not response.ok:
raise Exception(response.text)
# E.g. http://192.168.0.1:8082/api/jobs
url = "{}/api/jobs".format(self._deadline_url)
response = self._requests_post(url, json=payload)
if not response.ok:
raise Exception(response.text)
instance.data["deadlineSubmissionJob"] = response.json()
# Store output dir for unified publisher (filesequence)
instance.data["outputDir"] = os.path.dirname(output_filename_0)
instance.data["deadlineSubmissionJob"] = response.json()
def _get_maya_payload(self, data):
payload = copy.deepcopy(payload_skeleton)