JFYI, the full log of SMTD can be opened by pressing one of the two buttons at the very bottom of the SMTD UI (Open Log In Notepad or Open Log In Default Editor), or by going to the Tools menu of SMTD, and selecting “Explore SMTD Log Folder”, then locating the most recent file.
It looks like the first job fails to submit, and the second causes an error because PreviousJobsArray is empty, and we try to read the first entry from it, but there are zero entries. So the MAXScript error in the Listener is from the second job’s submission crashing. Now we need to understand why the first submission does not succeed. The full log would have had the message, but…
I have added prints of the results of the submission functions to the Listener:
(--start local scope
--If SMTD has not been opened yet, or has been closed since the start of 3ds Max, launch its UI:
if SMTD_MainRollout == undefined or not SMTD_MainRollout.open do macros.run "Deadline" "SubmitMaxToDeadline"
local theRenderer = renderers.current --get the current renderer
if isKindOf theRenderer VRay do --if it is VRay, we are good to go
(
--Render final image is disabled, light cache is set to render in the output dir
local oldRenderDialogState = renderSceneDialog.isopen() --see if the render dialog was open
renderSceneDialog.close() --close it before submission
rendSaveFile = false --disable output file saving
theRenderer.options_dontRenderImage = true --disable the rendering
local lcpath = getFileNamePath rendOutputFilename + getFileNameFile rendOutputFilename + ".vrlmap" --build the LC path name
theRenderer.lightcache_autoSave = true --enable LC auto-save
theRenderer.lightcache_autoSaveFileName = lcpath --and set the file name to the cache path
--Job sends to deadline
SMTDSettings.PreviousJobsArray = #() --clear the dependencies list
SMTDSettings.SubmitAsDependent = false --disable dependencies for first job submission
SMTD_MainRollout.getNameFromMaxScene() --update the job name in the UI
local oldJobName = SMTDSettings.JobName --store the current job name
SMTDSettings.JobName = oldJobName+" [VRay LC]" --set the LC job's name
local batchName = oldJobName + " [VRay LC + Render]" --a batch name to combine the two jobs
local result = SMTDFunctions.SubmitJobFromUI batchName:batchName --submit the job to Deadline as part of the batch
format "%\n" result
if SMTDSettings.PreviousJobsArray.count == 0 do return false
--Render final image is enabled, lc is switched to "from file" and uses the precalced light cache
rendSaveFile = true --re-enable output file saving
theRenderer.options_dontRenderImage = false --re-enable rendering
theRenderer.lightcache_autoSave = false --disable the auto save mode
local old_lightcache_mode = theRenderer.lightcache_mode --store the old mode
theRenderer.lightcache_mode = 2 --set LC mode to From File
theRenderer.lightcache_loadFileName = lcpath --set the load file to the cached path from the previous submission
--Job sends to deadline with the first as a dependency.
SMTDSettings.SubmitAsDependent = true --enable dependencies
SMTDSettings.DependencyJobItems = #{1} --set the dependency on the first entry from the list
SMTDSettings.DependOnPreviousJobMode = #last --set the mode to last, so only the last job is concidered
SMTDSettings.JobName = oldJobName+" [VRay Render]" --set the job name
local result = SMTDFunctions.SubmitJobFromUI batchName:batchName --submit to Deadline as part of the same batch
format "%\n" result
SMTDSettings.JobName = oldJobName --restore the job name
SMTDSettings.SubmitAsDependent = false --disable dependencies
SMTDSettings.DependencyJobItems = #{} --and clear the dependency jobs bitarray flags
theRenderer.lightcache_mode = old_lightcache_mode --restore the old cache mode
if oldRenderDialogState do renderSceneDialog.open() --reopen the render dialog if needed
)--end if
)--end local scope
What I don’t understand is why there is no submission report in the Log you sent me. Right after the command line arguments there should be the actual report from the deadline command call, but there is nothing, just the Restored the Material Editor Samples row. I have never seen anything like that… Let’s see what the modified script will print, if anything.