Different maya setups

Hi,

what would be the best way to have 2 or more different maya setup in deadline? I mean we have 1 repository, and depending on who does the submission, different environment vars., startup scripts etc. would be used. The only solution I can think of is to duplicate the mayabatch plugin, put a pulldown choice in the submission dialog which plugin to use, and have 1 batchfile for each plugin to start maya with the needed environments. But this is not so elegant. Any other solution?

Thanks,
Gabor

Hi Gabor,

Is there any way to detect the environment that is required based on any of the information that is currently submitted with the job? For example, the project or output path? If so, you might be able to write a PreLoad.py script for the MayaBatch plugin:
thinkboxsoftware.com/deadlin … -_Optional

If the project path can be used to determine the environment, you could do something like this:

from System import *
 
def __main__( *args ):
    projectPath = GetPluginInfoEntryWithDefault( "ProjectPath", "" )
    if projectPath.find( "ProjectA" ):
         Environment.SetEnvironmentVariable( "EnvVar1", "blah blah blah" )
    else:
         Environment.SetEnvironmentVariable( "EnvVar1", "foo bar" )

If it’s based on the user name, you could do something like this:

from System import *

def __main__( *args ):
    currJob = GetJob()
    if currJob.JobUserName == "someone" or currJob.JobUserName == "someoneelse":
         Environment.SetEnvironmentVariable( "EnvVar1", "blah blah blah" )
    else:
         Environment.SetEnvironmentVariable( "EnvVar1", "foo bar" )

If the info already exists in the job, then you don’t have to actually modify any existing scripts. Just create the PreLoad.py script and drop it in the MayaBatch plugin folder.

Cheers,

  • Ryan

Hi Ryan,

thanks for your feedback! Worked great, almost out-of-the-box, I just needed to change the condition, nothing else! :slight_smile: Great to have this option to preload things like this.
Thanks,
Gabor