Use an OCIO configuration file for color management

You can use an OpenColorIO (OCIO) configuration file to control the color spaces and transforms that are available. OCIO configuration files are designed to be used across a facility and are supported by many software applications. By using the same OCIO configuration file in Maya and other applications, you can ensure the compatibility of colors between them. For more information about OCIO, see http://opencolorio.org.

When you use a configuration file, you can select only the color spaces that are specified by the file. The natively supported color spaces are not available. In addition, different items may be available in different menus, if the configuration file defines specific roles for the color spaces. In particular, the author of the configuration file can define the "rendering" role to preset the Rendering Space preference to the desired value.

Note: As an alternative to specifying a configuration file in the preferences, you can set the OCIO environment variable. When the OCIO environment variable is set, then both Enable Color Management and Use OCIO configuration are activated on startup, on scene load, and for new scenes. In addition, OCIO config path is set to the path defined by the environment variable. Note also that the OCIO environment variable is overridden if you are using a color management policy as described in Use color management policies (external preference files).
  1. In your Color Management preferences , make sure that Enable Color Management is activated and other options are set as described in Important settings for color management.
  2. Enter the full, absolute path of a valid OpenColorIO configuration file in OCIO config Path.
  3. Activate Use OCIO configuration.
    • If the configuration file is not valid, you will be prompted to use the natively supported color spaces. If you click No, you will be prompted to select a different configuration file.
    • When switching between configurations, color spaces are matched by name. If any of the color spaces used in the current scene are not defined in the current configuration, a message will appear. In addition, any missing color spaces in image input nodes are highlighted in red in the Attribute Editor and no transformation is applied. See Fix missing color transforms.
  4. Optionally, you can toggle Use OCIO Input Color Space Rules, depending on whether you want to use the standard OpenColorIO rules to assign initial input color spaces to File textures and other image inputs when they are added to a scene. The OpenColorIO rules consider whether the color space name appears in the file name.
    • When Use OCIO Input Color Space Rules is on, only OCIO Standard Rule and Default appear in Input Color Space Rules below. You cannot add any other rules, and you cannot reorder them. You can only specify a color space for the Default rule, which is used only when the OCIO Standard Rule does not specify any color space for a particular file.
    • When this option is off, you can define your own rules to assign color spaces to input images in Input Color Space Rules. However, the available color spaces are restricted to those defined in the OCIO configuration file. See Define rules to assign color spaces for input files.

Supported OCIO roles

Maya supports the following roles that may be specified in an OCIO configuration file:
rendering
Used as the rendering space.
color_picking
Used when picking colors. See Specify or inspect color-managed color values.
reference
Used as the connection space for converting to and from other color spaces.

Switch OCIO contexts during a session

OCIO configuration files allow for the use of contexts, which are essentially environment variables that refer to color transform files. Contexts can be used to facilitate per-shot color grading, for example.

If you are using OCIO contexts, you can change their value during a session without restarting Maya. To do this, use MEL or Python commands to change the environment variable and then refresh the color management preferences.

For example, suppose that your configuration file uses a context named SHOT, which is currently set to abc123.spi1d, and you want to change it to ijk456.spi1d. In this case, you can run the following lines of MEL in the Script Editor:
putenv "SHOT" "ijk456.spi1d";
colorManagementPrefs -refresh;