Setting environment variables

Hi Steve –

The tk-multi-launchapp is the app that handles the launching of software from Desktop, Shotgun, or Create. The app has a hook called before_app_launch, which, as you might guess from the name, runs just before it launches software, and is often used to set the environment before launching.

Take a look at the hook here in github.

You can see that there’s even a commented out example of setting an environment variable in the default hook.

If you’re not familiar with the process of taking over hooks, there’s a very concise walk-through in this post – let me know if you hit any snags, and I can go into more details.

Hope that helps! Let us know if you have any other questions.

2 Likes