Handles OCIO shared view token

The OCIO config can return a special token ""
as the colorspace name for a display view. This commit
implements handling for this token, replacing it with the display
name if found.
This commit is contained in:
Jakub Jezek 2025-05-09 17:51:51 +02:00
parent 5b63541bf6
commit 539be6c527
No known key found for this signature in database
GPG key ID: 06DBD609ADF27FD9

View file

@ -1403,7 +1403,12 @@ def _get_display_view_colorspace_name(config_path, display, view):
"""
config = _get_ocio_config(config_path)
return config.getDisplayViewColorSpaceName(display, view)
colorspace = config.getDisplayViewColorSpaceName(display, view)
# Special token. See https://opencolorio.readthedocs.io/en/latest/guides/authoring/authoring.html#shared-views # noqa
if colorspace == "<USE_DISPLAY_NAME>":
colorspace = display
return colorspace
def _get_ocio_config_colorspaces(config_path):