mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 21:32:15 +01:00
Merge pull request #200 from aardschok/REN-44c
Update Submit VRay Scene logic
This commit is contained in:
commit
a32af24df4
4 changed files with 33 additions and 13 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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": {
|
||||
|
||||
|
|
|
|||
|
|
@ -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),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue