I’ve search around on here and the deadline max help doc and was unable to find a clear sample.
How can I add an additional Auxiliary file to 3ds Max (Maxscript) deadline job upon submission. In this case an additional XML file.
Once the deadline job is on the farm, how can i then access this file during the maxscript that is being executed on the render nodes? I need to know the path of where the XML file is.
Currently you cannot pass it as an argument to the SMTD submission function, you would have to build your own command line and call deadlineCommand yourself from your scripted code. In that case, additional auxiliary files are just further command line arguments behind the .MAX file and the .MS script file.
In the .MS file that implements the MAXScript code to run on the Slave, you can then use the
du.GetAuxFilename( index )
function to access the Nth auxiliary file where Index is 0-based.
So your additional aux.file would be index 2, because the .MAX file is index 0 and the .MS file is index 1. If the .MAX file is referenced via the SceneFile key in the Job metadata and is not included as an aux. file, then obviously you will be looking for index 1…
For testing, I submitted a MAXScript job which had the following additional lines inserted in its body:
du.LogMessage ("Aux 0:" + (du.GetAuxFilename 0) as string)
du.LogMessage ("Aux 1:" + (du.GetAuxFilename 1) as string)
du.LogMessage ("Aux 2:" + (du.GetAuxFilename 2) as string)
Since I did not submit a 3rd auxiliary file, the third line returned undefined:
2019-01-29 10:57:57: 0: Done executing plugin command of type 'Start Job'
2019-01-29 10:57:57: 0: Plugin rendering frame(s): 0
2019-01-29 10:57:57: 0: Executing plugin command of type 'Render Task'
2019-01-29 10:57:57: 0: INFO: Render Tasks called
2019-01-29 10:57:57: 0: INFO: Executing script: C:\Users\bobo\AppData\Local\Thinkbox\Deadline10\slave\YWG-9902945169\jobsData\5c508503c3ca517e802521d5\MAXScriptJob__16057.ms
2019-01-29 10:57:58: 0: INFO: Starting MAXScript Job...
2019-01-29 10:57:58: 0: INFO: Aux 0:C:\Users\bobo\AppData\Local\Thinkbox\Deadline10\slave\YWG-9902945169\jobsData\5c508503c3ca517e802521d5\untitled.max
2019-01-29 10:57:58: 0: INFO: Aux 1:C:\Users\bobo\AppData\Local\Thinkbox\Deadline10\slave\YWG-9902945169\jobsData\5c508503c3ca517e802521d5\MAXScriptJob__16057.ms
2019-01-29 10:57:58: 0: INFO: Aux 2:undefined
2019-01-29 10:57:58: 0: INFO: Finished MAXScript Job in 0.536 sec.
2019-01-29 10:57:58: 0: Done executing plugin command of type 'Render Task'