Create a ticket

Q100076: Using OCIO variables to dynamically change the Viewer Process in Nuke


This article explains how you can use variables to dynamically change the Viewer Process in Nuke using an OCIO config file. This enables you to assign different LUTs depending on the shot or show you are working on (i.e. using the $SHOT and $SHOW variables in your config.ocio file).



Part 1: Set up the config.ocio file

The config.ocio file is a text file which defines which LUTs should be used for different display processes. Each OCIO configuration has a config.ocio file at its root and Nuke comes with various ones which can be copied for testing purposes. These are located in your Nuke installation directory under /plugins/OCIOConfigs/configs/

An example is also attached at the bottom of this article in the archive provided. The video tutorial above goes through each of the key points listed below:

  1. In your config.ocio file you can use variables when defining your file path names to dynamically change the LUT applied in the Viewer Process. These will have to conform to the following syntax: "${variable}rest_of_filepath.extension" (example below step 3.)
  2. Open your config.ocio file
  3. Go to the file path you would like to make dynamic (in this example the attached file is used and line 50 is being modified)

    Original line:
    to_reference: !<FileTransform> {src: sRGB.spi1d, interpolation: linear}

    Modification to:
    to_reference: !<FileTransform> {src: "${SHOT}.spi1d", interpolation: linear}

    Be aware of the string denotations "" and the ${} syntax  (see above step 1.)


    NOTE: For a more complete test, it is recommended to setup at least 2 variables

  4. Each variable chosen in the config.ocio must not be a currently set environment variable, as this will prevent it from working.

Part 2: Set up Nuke value-key pairing 

  1. Start up Nuke and press [S] to open the Project Settings
  2. Under OCIO change:

    viewer process Luts : OCIO LUTs
    OCIO config : your custom/changed config, in this case it's OCIO_test

    If you have your config.ocio file in a different directory than Nuke's standard, you can select custom and browse to the corresponding file.

    NOTE: As the following part can be tricky, I recommend watching the above video for further clarification.

  3. In the top left corner of your Viewer you can select your Viewer Process
    In our example config.ocio we used SHOT within the sRGB process, so now select sRGB in the drop down list and then select 'show panel'.

    : 'show panel' will always give you a different OCIODisplay depending on which dropdown item you have selected.

  4. An OCIODisplay node pops up in your Properties view.
    Switch to the Context tab
  5. Add SHOT as your context and your key as key (in the example case sRGB). You can see the Viewer Process change if you change the value to Cineon instead.

  6. This only sets the context key pairing for the sRGB LUT. If you have another LUT that uses variables, you need to do the same for that Viewer Process, from Part 2 step 2 onwards.
    i.e. above in Part 1 we set the rec709 to TST, so now select rec709 in the Viewer Process drop down list and then click 'show panel'. Continue following the steps as described in Part 2.

Each of the Viewer Processes can use up to 4 key value pairs (variables) to define its LUT file path.


Keywords: OCIO, context, variables, viewerprocess, LUT
Was this article helpful?

We're sorry to hear that!

Please tell us why.
1 out of 2 found this helpful


  • Avatar
    Alexis Oblet

    Is there a way to change context variable programmatically ?

    Thank you.