© Square Enix © Goodbye Kansas


Table of Contents

This simple guide shows you how to control VFB OCIO through environment variables.

 

Overview


Users or pipeline TDs can dynamically change the VFB OCIO configuration from within the Houdini UI through Python. Usually, the OCIO variables are set up in the user environment and changing them requires you to exit Houdini, go to System > Environment Variables, manually update them and then restart Houdini. With Python, you can update the environment variables in the Python Shell, and tell Houdini to reload the configuration on the fly.

 

Workflow


1. Get the OCIO configuration by opening a Git shell and calling 'git clone https://github.com/imageworks/OpenColorIO-Configs.git'

2. Once the download is complete, open the Windows Start Menu and then - Edit the System Environment Variables.

3. In the System Properties window, go to Advanced > Environment Variables.

4. Under User variables (top half of the window), add the following variables using the New button:

OCIO - C:\autotesting\vray_for_houdini_tests\ASSETS\OCIO\aces_1.0.3\config.ocio
VRAY_VFB_OCIO_INPUT_COLORSPACE - ACES - ACEScg
VRAY_VFB_OCIO_VIEW_TRANSFORM - Rec.709

Note that in your case, the OCIO path might be different. Make sure to update it.

5. Start Houdini.

6. Add a V-Ray Renderer ROP and a test cube geometry. Then render.

7. In the VFB, under the Display Correction layer:

  • The correction must be set to OCIO after your env var setup.
  • The Input Colorspace must be ACES - ACEScg. If it isn't, something is wrong with your setup.
  • The View Transform must be Rec.709.

8. Open a Python Shell window by going to Houdini top menu > Window > Python Shell.

9. In the Python Shell:

  • Call import _vfh_ipr
  • Call import os
  • Call os.environ[‘VRAY_VFB_OCIO_VIEW_TRANSFORM’] to check the current value of the variable (it should be Rec.709).
  • Call os.environ[‘VRAY_VFB_OCIO_VIEW_TRANSFORM’] = ‘sRGB’ to change the variable value to sRGB.
  • Call _vfh_ipr.reloadOCIO() to update the configuration. You will notice that the change is not present in the VFB Display Correction tab yet.
  • Start a new render. If you check the Display Correction tab, the View Transform should now be changed to sRGB.

This workflow is also applicable when changing the OCIO path, or the Input Colorspace.