Re: Force a refresh of context variables?

dbr/Ben <dbr....@...>

If you only need a limited set of the env variables, you can set the Nuke node context tab up like so:

key1: SHOT
value1: [getenv SHOT]

..etc, then it will dynamically pick up changes to the SHOT env-var (without embedding the actual SHOT value in the Nuke nodes)

- Ben

On 14 Jan 2014, at 9:22, Mark Visser <mvi...@...> wrote:

Hi folks,

A feature that our artists fought long and hard to have is the ability to change shots from within their software, without going back to the shell and doing a "setshot" (which sets up various environment variables) and re-starting Nuke. To make that work, we alter the current environment via Python's os.environ.

I can't for the life of me see a way via the Python API to force OCIO to refresh its context variables from the environment -- or even a way to set context variables explicitly. I've tried creating a new config with OCIO.Config.CreateFromEnv / CreateFromFile and making it current with OCIO.SetCurrentConfig, but Nuke doesn't update to reflect the new config at all, let alone refresh the context variables. I see that the github master of OCIO has additional API methods for manipulating context variables via Config.getCurrentContext, but unfortunately Nuke is using 1.0.7, which doesn't seem to have these methods available.

I'm aware of the "Context" tab in the OCIO nodes, but the goal is to make the OCIO config part of the enclosing environment, not embed parts of it in .nk files.

Short of launching a new Nuke instance, is there any way to force a refresh of context variables?


You received this message because you are subscribed to the Google Groups "OpenColorIO Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ocio-dev+u...@....
For more options, visit

Join to automatically receive all group messages.