Settings Job Environment Variables

Is it possible to set job environment variables with a custom event. Or do you have to do this in the JobPreload script? The downside to the job preload script in this solution is that I would have to create a py file for every Plugin type.

The custom event would blanket all plugins in a single file.

this is what I’ve been looking at recently and have been using a modified version of the GitHub script

This grabs the env vars in use and sends them with the job which works great for maya / houdini with different versions of centrally installed plugins.

Seems to fail on C4D jobs though where the local user env vars get sent anyway and it trys to write temp stuff to the submission users folder which isn’t on the nodes.

There is the GlobalJobPreLoad file. It does what is says on the box, and is a JobPreLoad file for all plugin types.

1 Like

Does this just add the env vars you specify in the pyfile? Or can it work like the Event and pull the info from the submission?

I’m just wondering if I’d be better off using this per plugin instead of an Event and this way I’d avoid the c4d issue I’m having

You can read submission info from the JobPreLoad files, as they get a deadlinePlugin object passed to them. You can grab the job from it with job = deadlinePlugin.GetJob() and from there you can read submission information and set environment variables accordingly.