No matter what I try to set properties in SMTDSettings.
Deadline seems remembering the value once I set with Pipeline Tool UI.
What could be the way to submit Deadline job with Draft on?
No matter what I try to set properties in SMTDSettings.
Deadline seems remembering the value once I set with Pipeline Tool UI.
What could be the way to submit Deadline job with Draft on?
The SMTDSettings struct does NOT deal with the Pipeline Tools. The Pipeline Tools are external tools to 3ds Max, and are identical in all 3D applications that implement them. They are written in Python and are implemented by the scripts found in \\DeadlineRepository10\submission\Integration\Main\
SMTD merely calls these Python scripts via deadlinecommand
script execution and passes arguments like the name of the scene and the batch name. The Pipeline Tools remember these settings for that specific scene by writing to a settings file. This is why you are not allowed to open the Pipeline Tools until you have saved your scene file, as the scene is used as a key to store that information. Thus, the enabling of Draft for a particular .MAX scene persists between sessions, but not via any content written in the .MAX file or the SMTD settings - it is stored by the Pipeline Tools themselves (see ..\submission\Integration\Main\PipelineToolsSettingsWriter.py
)
Try this:
SMTDFunctions.GetPipelineToolStatus()
, which calls the JobWriter.py in the ..\submission\Integration\Main\
folder to read the value corresponding to that particular scene path.When SMTD submits a job after the Pipeline Tools have been enabled, it eventually calls the function SMTDFunctions.ConcatenatePipelineSettingsToJob()
which also executes the JobWriter.py script. But this time it tells it to append the Draft settings for the current scene to the .JOB file already created by SMTD. It uses the ExtraInfoKeyValue#=Key=Value
entries to do so.
So you could look at what ExtraInfoKeyValue entries a Draft submission produces, and set your own ExtraInfoKeyValue entries via SMTD without ever enabling the Pipeline Tools Draft option for your specific scene. Just pretend that the values you output were created by the Pipeline Tools…
Here is what I got when I enabled Quick Draft in Pipeline Tools and submitted without touching any other settings:
In the Submission Params, you can see them in the Job Info Parameters list:
Since SMTD allows you to set your own Extra Keys via the SMTDSettings.ExtraInfoKeyValues
array, you would have to set it to something like
SMTDSettings.ExtraInfoKeyValues = #(
#("DraftFrameRate","24"),
#("DraftType","movie"),
#("DraftExtension","mov"),
#("DraftCodec","mjpeg"),
#("DraftQuality","85"),
#("DraftColorSpaceIn","Identity"),
#("DraftColorSpaceOut","Identity"),
#("DraftResolution","1"),
#("SubmitQuickDraft","True")
)
So even if your SMTD has “Draft Off” in the UI, this should have the same effect at the end of the rendering of your new job - a QuickDraft job would be spawned!
This is not exactly public knowledge (it is not documented as far as I can tell), but it is also not secret as all the code in SMTD and the Integration scripts is available… I will make a note that it needs to be documented better.
Continuing from my previous post, the solution only works if the scene in question does NOT have its Pipeline Tools enabled.
This is because the concatenate function in the JobWriter.py script reads the JOB file written by SMTD into a dictionary, kills the custom extra keys you might have provided, and injects its own, then writes out a new file that contains the Pipeline Tools values and excludes yours.
In other words, the SMTD UI Pipeline Tools settings always override any custom values from SMTDSettings.ExtraInfoKeyValues.
But in a custom submission pipeline that does not even expose the SMTD UI to the end user, this should not be an issue - just define the required values in the SMTDSettings.ExtraInfoKeyValues array of arrays, and your jobs should spawn Draft jobs when they finish rendering.
The script file PipelineToolsSettingsWriter.py
is responsible for storing the Pipeline Tools data on disk. You can find in the last lines of the script how the JSON filename is built:
def GetPathToPipelineToolSettings( appName, user, sceneName, sceneKey ):
""" Method for generating the path to a scene's pipeline tool settings.
Arguments:
appName (str): Name of the application being used (Ex. Maya, 3ds Max).
user (str): Name of the machines user (Ex. chris)
sceneName (str): Name of the current scene.
sceneKey (str): 10 character unique key
"""
return os.path.join(ClientUtils.GetUsersSettingsDirectory(), "pipeline_tools",
appName + "_" + user + "_" + sceneName + "_" + sceneKey + ".JSON")
So if I set up a MAX scene with the name “Drafttest”, I can see in the folder C:\Users\bobop\AppData\Local\Thinkbox\Deadline10\settings\pipeline_tools
the corresponding file 3dsmax_bobop_drafttest_30cc2ef230.JSON
which contains the settings for that specific scene. Note that the hexadecimal hash portion at the end of the filename reflects both the path and the filename of the MAX scene. This is true for other applications like Maya, except their settings files will have a “Maya” prefix instead.
The file contains something like
{"DraftFrameRate": "24", "DraftType": "movie", "DraftExtension": "mov", "DraftCodec": "mjpeg", "DraftQuality": 85, "DraftColorSpaceIn": "Identity", "DraftColorSpaceOut": "Identity", "DraftResolution": "1", "SubmitQuickDraft": true}
Deleting the file disables the Draft settings of the Pipeline Tools for that particular scene!