AWS Thinkbox Discussion Forums

MayaBatch Usersetup.py

Hi,

We’re having some issues with MayaBatch not running our global usersetup.py file, we set the directory with the MAYA_SCRIPT_PATH environment variable. When I run the command that the Mayabatch job in Deadline generates on the command line it correctly runs our script and prints the response I’m expecting but it doesn’t seem to do this within Deadline. Are you overriding this variable or is there something I need to do to make it use our file?

Thanks

Nick

We don’t touch any of the Maya config variables unless they’re to work around known problems. The full list of what we meddle with is this:

MAYA_DEBUG_ENABLE_CRASH_REPORTING
MAYA_DISABLE_CIP
MAYA_DISABLE_CER
MAYA_DISABLE_CLIC_IPM
MAYA_OPENCL_IGNORE_DRIVER_VERSION
MAYA_VP2_DEVICE_OVERRIDE

Hi Edwin,

That’s what I thought. The thing is when I run the command from the Deadline error log directly on the machine I get a print that shows it’s running our usersetup.py file (see below, highlighted in red) but I don’t get this from Deadline, as you can see from the log file below. I’m wondering whether it’s because you’re explicitly setting PYTHONHOME and this is bypassing our PYTHONPATH variable?

Any thoughts would be great!

Nick

Actually, we don’t need to do that anymore since we hard code the path for Python into Deadline nowadays. The times of meddling with PYTHONHOME and PATH are over!

For this problem though… I think something from your pipeline is doing this:

2017-05-02 14:08:42: 0: INFO: Setting PYTHONHOME to C:\Program Files\Autodesk\Maya2017\Python for this session

The usual method for figuring out where this is happening is to check the job properties’ “environment” section, and if it’s there usually it’s a submission script. If it’s not there, then its either in the Plugin or the PreJob script.

Hi Edwin,

We’re not doing anything fancy with the submission at the moment, we’re not running any scripts and our environments section is empty. The usersetup.py is not even trying to do anything complicated we’re just trying to force Arnold to load so it doesn’t crash out when it tries to render and can’t find the attributes.

Thanks

Nick

Hmm. Just for funzies I went and looked through all of my Repos for “PYTHONHOME”. I have to back pedal a bit about my comment about that not being set with the other variables in the Maya plugins.

We are pretty clearly setting PYTHONHOME for Maya but not for ourselves in core, which it looks like has been done since at least 7.2. I feel like we set this to help Maya load correctly, but you could comment it out of the plugin to see if it makes any sort of difference (better plan below). Just look for “PYTHONHOME” in “[repo]/plugins/MayaBatch/MayaBatch.py” after making a backup. There should be two locations in the file.

Another test would be to set PYTHONHOME in the command line to be “C:\Program Files\Autodesk\Maya2017\Python” and see if that causes the same failure. I’m not expecting it to be problematic though.

I changed that value and other than not getting the message anymore it doesn’t seemed to have changed anything. Is there any way to see what the environment variables are at the time it launches MayaBatch? I’m wondering if something’s changing with the environment before Deadline launches MayaBatch and it’s ignoring our PYTHONPATH and MAYA_SCRIPT_PATH variables.

Below is the beginning of the task log, I’m expecting to see a print from our usersetup.py after the red line. Just to confirm that it works I tried putting a usersetup.py file in the local C:\users\render\C:\Users\Render\Documents\maya\2017\scripts folder with a simple print and this was loaded fine in Deadline and printed to the log file but when loaded on the command line both files print…

Nick

The only way I can think of to get the variables dumped out would be to make a batch script that ran something like the following:

set

then, configure the Deadline plugin for MayaBatch to load it instead of Maya. It would be skipped over on any machine that lacked the batch file, so you could isolate the test to one machine. It’ll load up, then likely lock as the plugin would be expecting the standard “mel:” prompt before continuing. I can help you bake that out or test if you need. Maybe we can just set up a remote session and finish this off in 30 minutes.

Hi there,
Just had the same issue (mayaBatch job on deadline not loading userSetup.py), and researchs pointed here.

It seems only userSetup.mel scripts are loaded through MAYA_SCRIPT_PATH. I was able to launch userSetup.py from userSetup.mel

About rendering the environment: As a last resort, you can always hop into the plugins dir for MayaBatch and edit the MayaBatch.py file directly to print out the environment at some stage. Or create your custom plugin that’s a modified version of MayaBatch.

Privacy | Site terms | Cookie preferences