I’ve been trying to find a way to remotely set an environment variable (say, MAYA_SCRIPT_PATH) on machines installed with Deadline Slave.
The Commandline Script plugin came to mind, but putting
“set MAYA_SCRIPT_PATH=C:\scripts”
into the submission script returns a error that says “set” does not exist.
The command script plugin needs a full path to the executable it’s going to run, which is why it can’t find ‘set’. Normally, we would suggest placing “set MAYA_SCRIPT_PATH=C:\scripts” in a batch file on the network, and running that instead. However, I think the environment variable would only be set for that session, so once the batch file finishes, it’s reverted.
You could modify the MayaCmd and MayaBatch plugins to set this environment variable before rendering. In MayaCmd.py, this would be done in the PreRenderTasks() function, and in MayaBatch.py, this would be done in the StartJob() function. You would first have to add the following to the top of each file:
from System import *
You could then add the following line to the beginning of each function mentioned above:
Environment.SetEnvironmentVariable( "MAYA_SCRIPT_PATH", "C:\\scripts" )
Cheers,
- Ryan