Getting started with OCIO in RV

RV has a couple of nodes that can be used instead of or complimentary to the RV’s color pipeline.

You can get some info about OCIO in RV here: OpenColorIO Integration

If you check out the OCIO package info in the Package manager RV -> Preferences -> Packages -> OpenColorIO Basic Color Management , there’s a bit of a description about how OCIO can be auto-setup via a script. You can create file in your support path under the Python directory to have your own script auto-determine color pipeline.

Attached is a minimal example that might serve well as a bootstrap for setting up your config. The ocio_config_from_media is called when needed and helps you dynamically set up your config. You can even create the OCIO config programmatically if you so wanted to, or just set it to an appropriate config location, set the environment variable and be done. (2.2 KB)

Drop the file as in your PYTHONPATH (such as in your Python path in your RV_SUPPORT_PATH) and this will prove as a configuration script and entrypoint for your OCIO setup.

If you look under Open Color IO Integration docs, there’s a ocio_context component. The OCIO context variables can work off of environment variables, but environment variables for context variables in OCIO are not required.

The way this works is, by default, OCIO context variables will incorporate any environment variable as a fallback. But in the setting up a node, you can also define additional context variables. This allows each node to have its own context apart from your environment, therefore no special environment variables are actually needed.

So while the example script defines the context based on the environment variable and uses a default value like this:

 "context"    : {"SHOT" : os.environ.get("SHOT","def123")}

the context could just as easily be defined by some other lookup, such as one defined by a function that looks it up from Shotgun. For example, this:

 "context"    : {"SHOT" : findShotgunShotByMedia(media)}
1 Like