Shotgun Desktop - Hook/Set environement Vars based on loaded pipeline config?

Heya,

Im trying to find a way to set some ENV vars during Shotgun Desktop’s project load.
I wish to change some variables based on if we are loading the primary config or not.

Where would I do this?

2 Likes

The engine_init.py core hook should be run when the engine finishes starting up. This will be run after the apps are loaded, but before they can be launched.
It depends on how early in the process you need to set these.

Do these variables need to be set before the app’s initialized?

1 Like

Yep, because the variables I’ll set have to do with where some hooks for apps (not necesarily inside DCC’s) are loaded.

I have a “Global Pipeline Setup primary”, and a beta config for that.
Then each of my shows has a primary and beta.
Most of the publisher plugins point to a %SGTK_MASTER_CONFIG% which by default points to my “Global Pipeline Setup Primary”.

However if I load the beta setup of a show I want it to switch the %SGTK_MASTER_CONFIG% from the “Global Pipeline Setup primary” to the “Global Pipeline Setup beta” so I’m in complete beta mode for both the show and the global pipe.

1 Like

Ah yes, sorry I remember now, you were trying to centralize things. The engine_init.py doesn’t sound like it’s suitable for what you need.
In my post here I provided a config as an example, and that uses the bootstrap.py core hook, which I think is probably what you need.

2 Likes

Awesome, Im going to look into that!

2 Likes