From 64dd82d08f55832eb33f1f44620d2cae2d5c0ddd Mon Sep 17 00:00:00 2001 From: wikoreman Date: Wed, 24 Oct 2018 12:35:49 +0200 Subject: [PATCH 1/4] Updated submit to match MayaBatch job, added framesPerTask, improved job name --- .../maya/publish/submit_vray_deadline.py | 36 +++++++++++++------ 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/colorbleed/plugins/maya/publish/submit_vray_deadline.py b/colorbleed/plugins/maya/publish/submit_vray_deadline.py index a137a9b5e6..16fa6d02a2 100644 --- a/colorbleed/plugins/maya/publish/submit_vray_deadline.py +++ b/colorbleed/plugins/maya/publish/submit_vray_deadline.py @@ -51,6 +51,9 @@ class VraySubmitDeadline(pyblish.api.InstancePlugin): filename, vrscene_output) + start_frame = int(instance.data["startFrame"]) + end_frame = int(instance.data["endFrame"]) + # Primary job self.log.info("Submitting export job ..") @@ -60,31 +63,35 @@ class VraySubmitDeadline(pyblish.api.InstancePlugin): "BatchName": batch_name, # Job name, as seen in Monitor - "Name": task_name, + "Name": "{} [{}-{}]".format(task_name, start_frame, end_frame), # Arbitrary username, for visualisation in Monitor "UserName": deadline_user, - "Plugin": "MayaCmd", - "Frames": "1", + "Plugin": "MayaBatch", + "Frames": "{}-{}".format(start_frame, end_frame), + "FramesPerTask": instance.data.get("framesPerTask", 1), "Comment": context.data.get("comment", ""), + + "OutputFilename0": os.path.dirname(first_file), }, "PluginInfo": { + # Renderer + "Renderer": "vray", + # Mandatory for Deadline "Version": cmds.about(version=True), # Input "SceneFile": filepath, - # Output directory and filename - "OutputFilePath": vrscene_output.replace("\\", "/"), - - "CommandLineOptions": self.build_command(instance), - - "UseOnlyCommandLineOptions": True, "SkipExistingFrames": True, + + "UsingRenderLayers": True, + + "UseLegacyRenderLayers": True }, # Mandatory for Deadline, may be empty @@ -133,19 +140,26 @@ class VraySubmitDeadline(pyblish.api.InstancePlugin): sequence_filename = ".".join([instance.name, ext]) output_filename = os.path.join(render_ouput, sequence_filename) + # Ensure folder exists: + if not os.path.exists(render_ouput): + os.makedirs(render_ouput) + payload_b = { "JobInfo": { "JobDependency0": dependency["_id"], "BatchName": batch_name, - "Name": "Render {}".format(task_name), + "Name": "Render {} [{}-{}]".format(task_name, + start_frame, + end_frame), "UserName": deadline_user, "Frames": "{}-{}".format(start_frame, end_frame), "Plugin": "Vray", "OverrideTaskExtraInfoNames": False, - "Whitelist": "cb7" + + "OutputFilename0": render_ouput, }, "PluginInfo": { From c3c11f63be7e7c31d7e9d270c46980a008197e90 Mon Sep 17 00:00:00 2001 From: wikoreman Date: Wed, 24 Oct 2018 12:37:25 +0200 Subject: [PATCH 2/4] Added vrscene_render_on to validator --- .../maya/publish/validate_vray_translator_settings.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/colorbleed/plugins/maya/publish/validate_vray_translator_settings.py b/colorbleed/plugins/maya/publish/validate_vray_translator_settings.py index ecd97e6f95..f28801b708 100644 --- a/colorbleed/plugins/maya/publish/validate_vray_translator_settings.py +++ b/colorbleed/plugins/maya/publish/validate_vray_translator_settings.py @@ -38,6 +38,10 @@ class ValidateVRayTranslatorEnabled(pyblish.api.ContextPlugin): node = vray_settings[0] + if cmds.setAttr("{}.vrscene_render_on".format(node)): + cls.log.error("Render is enabled, this should be disabled") + invalid = True + if not cmds.getAttr("{}.vrscene_on".format(node)): cls.log.error("Export vrscene not enabled") invalid = True @@ -62,6 +66,7 @@ class ValidateVRayTranslatorEnabled(pyblish.api.ContextPlugin): else: node = vray_settings[0] + cmds.setAttr("{}.vrscene_render_on".format(node), False) cmds.setAttr("{}.vrscene_on".format(node), True) cmds.setAttr("{}.misc_eachFrameInFile".format(node), True) cmds.setAttr("{}.vrscene_filename".format(node), From 0ebabdb6f2635139818bca3fff7fdc7bffdf831a Mon Sep 17 00:00:00 2001 From: wikoreman Date: Wed, 24 Oct 2018 12:37:53 +0200 Subject: [PATCH 3/4] Added frames per task --- colorbleed/plugins/maya/create/colorbleed_vrayscene.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/colorbleed/plugins/maya/create/colorbleed_vrayscene.py b/colorbleed/plugins/maya/create/colorbleed_vrayscene.py index b9f404e1d3..82f1b11682 100644 --- a/colorbleed/plugins/maya/create/colorbleed_vrayscene.py +++ b/colorbleed/plugins/maya/create/colorbleed_vrayscene.py @@ -20,7 +20,8 @@ class CreateVRayScene(avalon.maya.Creator): "suspendRenderJob": False, "suspendPublishJob": False, "extendFrames": False, - "pools": "" + "pools": "", + "framesPerTask": 1 }) self.options = {"useSelection": False} # Force no content From 3aeac688087a117d216005bf4d232bcf3d9cc045 Mon Sep 17 00:00:00 2001 From: wikoreman Date: Wed, 24 Oct 2018 14:18:33 +0200 Subject: [PATCH 4/4] Added . to extension to ensure regex works when publishing --- colorbleed/plugins/maya/publish/collect_vray_scene.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/colorbleed/plugins/maya/publish/collect_vray_scene.py b/colorbleed/plugins/maya/publish/collect_vray_scene.py index fe1015ee65..c97d7fc44b 100644 --- a/colorbleed/plugins/maya/publish/collect_vray_scene.py +++ b/colorbleed/plugins/maya/publish/collect_vray_scene.py @@ -86,7 +86,7 @@ class CollectVRayScene(pyblish.api.ContextPlugin): "endFrame": end_frame, "renderer": "vray", "resolution": resolution, - "ext": extension, + "ext": ".{}".format(extension), # instance subset "family": "VRay Scene",