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

Commit

Permalink
Merge pull request #446 from pypeclub/feature/maya-tile-rendering-revamp
Browse files Browse the repository at this point in the history
Maya:  better tile rendering support in Pype
  • Loading branch information
mkolar authored Aug 21, 2020
2 parents 7d0df19 + 63c2cf6 commit cefcfe1
Show file tree
Hide file tree
Showing 5 changed files with 330 additions and 107 deletions.
38 changes: 16 additions & 22 deletions pype/plugins/global/publish/submit_publish_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,26 +278,14 @@ def _submit_deadline_post_job(self, instance, job, instances):
# Mandatory for Deadline, may be empty
"AuxFiles": [],
}
"""
In this part we will add file dependencies instead of job dependencies.
This way we don't need to take care of tile assembly job, getting its
id or name. We expect it to produce specific file with specific name
and we are just waiting for them.
"""

# add assembly jobs as dependencies
if instance.data.get("tileRendering"):
self.log.info("Adding tile assembly results as dependencies...")
asset_index = 0
for inst in instances:
for represenation in inst.get("representations", []):
if isinstance(represenation["files"], (list, tuple)):
for file in represenation["files"]:
dependency = os.path.join(output_dir, file)
payload["JobInfo"]["AssetDependency{}".format(asset_index)] = dependency # noqa: E501
else:
dependency = os.path.join(
output_dir, represenation["files"])
payload["JobInfo"]["AssetDependency{}".format(asset_index)] = dependency # noqa: E501
asset_index += 1
self.log.info("Adding tile assembly jobs as dependencies...")
job_index = 0
for assembly_id in instance.data.get("assemblySubmissionJobs"):
payload["JobInfo"]["JobDependency{}".format(job_index)] = assembly_id # noqa: E501
job_index += 1
else:
payload["JobInfo"]["JobDependency0"] = job["_id"]

Expand Down Expand Up @@ -729,7 +717,8 @@ def process(self, instance):
"pixelAspect": data.get("pixelAspect", 1),
"resolutionWidth": data.get("resolutionWidth", 1920),
"resolutionHeight": data.get("resolutionHeight", 1080),
"multipartExr": data.get("multipartExr", False)
"multipartExr": data.get("multipartExr", False),
"jobBatchName": data.get("jobBatchName", "")
}

if "prerender" in instance.data["families"]:
Expand Down Expand Up @@ -906,8 +895,13 @@ def process(self, instance):
# We still use data from it so lets fake it.
#
# Batch name reflect original scene name
render_job["Props"]["Batch"] = os.path.splitext(os.path.basename(
context.data.get("currentFile")))[0]

if instance.data.get("assemblySubmissionJobs"):
render_job["Props"]["Batch"] = instance.data.get(
"jobBatchName")
else:
render_job["Props"]["Batch"] = os.path.splitext(
os.path.basename(context.data.get("currentFile")))[0]
# User is deadline user
render_job["Props"]["User"] = context.data.get(
"deadlineUser", getpass.getuser())
Expand Down
2 changes: 2 additions & 0 deletions pype/plugins/maya/create/create_render.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,8 @@ def _create_render_settings(self):
self.data["useMayaBatch"] = False
self.data["vrayScene"] = False
self.data["tileRendering"] = False
self.data["tilesX"] = 2
self.data["tilesY"] = 2
# Disable for now as this feature is not working yet
# self.data["assScene"] = False

Expand Down
2 changes: 2 additions & 0 deletions pype/plugins/maya/publish/collect_render.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,8 @@ def process(self, context):
"resolutionHeight": cmds.getAttr("defaultResolution.height"),
"pixelAspect": cmds.getAttr("defaultResolution.pixelAspect"),
"tileRendering": render_instance.data.get("tileRendering") or False, # noqa: E501
"tilesX": render_instance.data.get("tilesX") or 2,
"tilesY": render_instance.data.get("tilesY") or 2,
"priority": render_instance.data.get("priority")
}

Expand Down
Loading

0 comments on commit cefcfe1

Please sign in to comment.