Deadline 6.0 - Job Environment Variables

In my studio, we run command line(Windows) to setup different environment variables for each projects and launch Maya and Nuke under this environment setting. So, each render jobs will need different environment variables to kick off Maya and Nuke’ render to load different script and plugin. We think Deadline 6.0 can help us to fulfill this need.

I read the Manual of Deadline 6.0. There is a new function “IncludeEnvironment=True” that I can grab all the environment variables from the submitter’s environment and set them as the job’s environment variables. It seems it is perfect solution for our team.

I would like to add this flag when I use the Maya integrated submission script. If I can do this in Deadline Monitor by MayaSubmission, it is also great too.
Is it possible?

Thanks…:slight_smile:

Alan

Hey Alan,

There currently isn’t any options in the current submitter to turn this on (as I’m sure you noticed), but you can still achieve this with a fairly simple custom change to the Maya submitter.

The file you’d want to change is located in the Deadline repository at this location: ‘submission/Maya/Main/SubmitMayaToDeadline.mel’. Assuming that you just want this on all the time, you’ll just need to add a line of code to the spot where we write out the Job options, look for this bit of code (should be around line 1485):

	fprint $fileId ( "ConcurrentTasks=" + `intSliderGrp -q -v frw_ConcurrentTasks` + "\n" );
	fprint $fileId ( "Department=" + `textFieldGrp -q -text frw_Department` + "\n" );
	fprint $fileId ( "Group=" + `optionMenuGrp -q -value frw_Group` + "\n" );
	fprint $fileId ( "LimitGroups=" + `textFieldGrp -q -text frw_limitGroups` + "\n" );
	fprint $fileId ( "JobDependencies=" + `textFieldGrp -q -text frw_dependencies` + "\n" );

You’ll want to add this line after those ones:

	fprint $fileId ( "IncludeEnvironment=True\n" );

IMPORTANT NOTE: Custom script changes are left entirely up to you to maintain between Deadline versions. Upgrading the repository might clobber any changes you made to the scripts that ship with Deadline, so you might have to re-make this change after upgrading Deadline.

Hope this helps!

Cheers,

  • Jon

WOW…it works.
Thank you so much.

Appreciate your quick reply…:slight_smile:

No problem, glad to be of help!

This seems to work really well for adding ALL my LOCAL environment variables. Some of which are pointed to paths that don’t exist on our network machines.
There are 6 specific variables that I need to set on job submission. Currently I have to submit the job as suspended, then go through the monitor and manually add those 6 variables, one at a time. So, if my job has 10 layers, then I have to manually go into each job and add the variables…one at a time. Is there no way to set these variables once during submission instead of doing it 60 times after submission?

Thanks
Conrad

edit - using all the local settings is a problem since some of the local environment paths are located in a user-specific folder, which obviously can’t be found unless the same user account exists on the network machine. The error message is:

Unable to locate valid MAYA_APP_DIR. Please specify a writable directory where Maya can store user data.

that’s because the local MAYA_APP_DIR in the job properties is set to “C/Users/Conrad/Documents/maya” and I’ve never created the same account on any of the network slaves. so, by including ALL the environment variables, I’m adding 84 that I don’t actually need, and some of those are user-specific, so they’re not available on our slave machines.

Hey Conrad,

You can also use a similar method to set specific environment variables, the ‘IncludeEnvironment’ is meant more for a general catch-all method.

To set specific ones, you can use the ‘EnvironmentKeyValue#’ submission option (documented here: thinkboxsoftware.com/deadlin … nt_Options). In the maya submitter (in the context of my previous answer in this thread), it would look something like this:

fprint $fileId ( "EnvironmentKeyValue0=MAYA_APP_DIR=C:\\Program Files\\maya\n" );

Note that you’ll obviously want to swap the paths (make sure to escape backslashes in the path, though, as I did above) to whatever is appropriate. You can also add more Environment variables to set, of course; just make sure to increment the # in ‘EnvironmentKeyValue#’ as you go.

Hope this helps!

Cheers,

  • Jon