Deadlinecommandbg.exe from 3dsmax Python3 can break due to PYTHONPATH

Yuck, found a funky bug/issue with 3dsmax 2022, maxscript, Python3 and Thinkbox Deadline 10.1, suprised this hasn’t been flagged before? Anyone using Max2022 with Deadline who isn’t having this issue? Might only affect larger studios with more complex python setups.

The following is happening using our own custom submitter but that is built on the same code that’s in SMTD_Functions so I assume it’d happen with vanilla Deadline 10.1 too.

When sending jobs to Deadline from max, our jobs weren’t getting submitted and the output files for std out were only being created with a *.tmp extension…
Deadline tries to run this cmd to submit a job…

C:\Program Files\Thinkbox\Deadline10\bin\deadlinecommandbg.exe -outputFiles “C:\temp\submitOutput.txt” “c:\temp\submitExitCode.txt” “\myjob_submit_info.job” “\myjob_job_info.job”

but ends up creating output files named

submitOutput.txt_rq9d.tmp

Running the above cmd in a new cmd shell from outside of max works fine, only doesn’t work in max 2022.
shellLaunch() or doscommand or hiddenDOScommand all run a cmd-shell with the environment inherited from max. We found it was the PYTHONPATH that we have set for max that stops deadlinecommandbg.exe from running successfully guessing this is something to do with us having a particular python3 module that deadlinecommandbg then tries to use instead of what it should get from it’s own path.
if I shellLaunch "cmd" "" and then run the above command it doesn’t work.
if I do this in the cmd shell that has been launched from max;

set PYTHONPATH=

then it will work…

so if before running deadlinecommandbg.exe we store our PYTHONPATH and set it to “” and then restore after running deadlinecommandbg.exe that is also a simple solution to the problem.

1 Like
Privacy | Site terms | Cookie preferences