I’m trying to use the Batch grouping system in Deadline 7+ to group our jobs that get sent from our render management tool. From one file we will often send 5-10 passes, which can be animation frames, tile renders, Draft Tile Assemblies and Draft dependent Jobs and I’d like them to all be group.
I’ve been trying to pass a batchName argument to:
fn CreateSubmitInfoFile
I assume that
SMTDSettings.UseBatchRender and SMTDSettings.BatchRenderMode
Are things that need to be set to make Deadline see the job as part of a Batch?
Does it need to be that the first one is set to be a master batch file and then the others are slaves of this?
Our submission code is loosely based on this which Bobo supplied to us a few years ago…
[code] (
rendSaveFile = true
global SMTDSettings --this is the global variable that will contain the submission settings of SMTD
global SMTDFunctions --this is the global variable that will contain the submission functions of SMTD
local theNetworkRoot = "" --this variable will hold the network root path - the path to the Repository
local theHomeRoot = "" --this variable will hold the local home folder of Deadline
--------------------------------------
--MAIN SUBMISSION CODE
--------------------------------------
theNetworkRoot = "\\\\xxx\\DeadlineRepository" --repository location
format "Network Root is '%'\n" theNetworkRoot
--First, we load the script file with the function definitions
local remoteScript = theNetworkRoot + "\\submission\\3dsmax\\SubmitMaxToDeadline_Functions.ms" --this is the file name on the Repository
local localScript = getDir #userscripts + "\\SubmitMaxToDeadline_Functions.ms" --to speed things up, we will copy it locally first, then we will load it
if doesFileExist remoteScript then --if the remote file exists,
(
deleteFile localScript --we delete the local file in case it exists already
copyFile remoteScript localScript --then we copy the remote file over
fileIn localScript quiet:true --and execute it (equivalent to Main Menu > MAXScript > Run Script...)
--At this point, SMTDFunctions should have been initialized to the latest version found on the Repository.
--Now we have to make sure all defaults (both global and local) are loaded, otherwise the SMTDSettings struct would contain factory defaults
SMTDFunctions.loadSettings()
local TempMaxFile = maxfilepath + maxfilename
SMTDSettings.JobName = getFileNameFile TempMaxFile + " [BATCH SUBMISSION BETA]" --we could for example set the job name to the name of the max file and any custom text we want
SMTDSettings.Comment = "Submitted from the batch Custom Submitter" --we could set the comment field
SMTDSettings.Priority = 100 --we can override the priority, for example we could increment the priority based on the order of the files or something else
SMTDSettings.ChunkSize = 1
SMTDSettings.SubmitSceneMode = #reposave --changed to +Mode in Deadline 5.1
SMTDSettings.TilesRendering = true --we don't really have to enable this, because the call to spawnTileJobs() will set it to true anyway
SMTDSettings.TilesInX = 10 --we define the horizontal tiles count
SMTDSettings.TilesInY = 10 --and the vertical tiles count
SMTDSettings.SingleTileJob = true --we will submit a single frame as one job where each task will represent a tile
SMTDSettings.SingleTileJobDependent = true --we will submit a dependent job to combine the tiles
SMTDSettings.SingleTileJobCleanup = true --and we will clean up after us, leaving the assembled image but deleting the tiles files. Set to false if you want to rerender later.
retCode = SMTDFunctions.spawnTileJobs forceMaxFile:TempMaxFile --this is the function that does all the useful work spawning the tile render
--Once the command returns, we can try to get the message from the message file. Even if it failed, the file could contain userul error info...
local renderMsg = SMTDFunctions.getRenderMessage()
SMTDFunctions.getJobIDFromMessage renderMsg --we can also extract the job ID from the render message - it will be stored in SMTDSettings.DeadlineSubmissionLastJobID
if retCode == true then --retCode returns true from SMTDFunctions.spawnTileJobs() if sucessful.
(
format "File % submitted successfully as Job %.\n\n%\n\n" (filenameFromPath TempMaxFile) SMTDSettings.DeadlineSubmissionLastJobID renderMsg
SMTDFunctions.CopyExternalFilesToRepository() --copy files to main job
)
else --if the code was anything else, we print the message as error message
format "Job Submission FAILED.\n\n%" renderMsg
)--end if root resolved
)--end script[/code]
BatchName isn’t stored in SMTDSettings and is unrelated to those SMTDSettings you cited in your post. (Those are for the old skool 3dsMax Batch Render facility)
You just simply set the KVP in the submit info file such as:
batchName = "anything you like"
format "BatchName=%\n" batchName to:submitInfoFile
By essentially giving all your submitting jobs the same “BatchName=something” key=value pair, monitor will group them up for you.
There is another function, which you might want to hook into, as it will ensure any job name formatting takes place via our _Formats.ini maxscript lookup file.
fn getBatchName =
(
(SMTDFunctions.FormatJobName SMTDSettings.JobName) + " BATCH [" + localtime +"]"
)