Required Roles
Brendan
I've been using "default" (aka ROLE_DEFAULT) as my default color spaces, but then looking at the docs, I guess the "default" role isn't required to be in a config. Is "scene_linear" required? Any others? Somehow strictparsing is involved?
> I've been using "default" (aka ROLE_DEFAULT) as my default color spaces, but then looking at the docs, I guess the
> "default" role isn't required to be in a config. Is "scene_linear" required? Any others? Somehow strictparsing is involved?
Brendan, the default role was used used by the v1 feature for extracting a color space name from an image file path. If strict parsing was not enabled and no color space name was found, then the default color space is returned. The default role was also used by some other API calls, such as getIndexForColorSpace (although that is not the case for OCIO v2).
Not sure if your question was for OCIO v1 or v2 (that is, master branch). The documentation you linked to is for v1. Note that the v2 documentation remains to be written (and we are looking for volunteers to help us with that!).
The new File Rules feature in v2 expanded the ability for users to assign color spaces based on file paths. If you're interested in that topic, please check out PR #904.
A v2 config must specify a default color space, but this could either be done using the default role or a default file rule. So if the config does not use file rules, then yes, the default role is required.
As Troy wrote, the scene linear role is required by ociocheck, which also verifies that any supplied roles have color spaces that exist. However it does not require any other roles and I don't believe any others are required.
Doug
ociocheck and sanity check should abide by the following
As Troy wrote, the scene linear role is required by ociocheck, which also verifies that any supplied roles have color spaces that exist. However it does not require any other roles and I don't believe any others are required.
pre-established roles I believe:
```
ociocheck --iconfig config.ocio
OpenColorIO Library Version: 1.1.1
OpenColorIO Library VersionHex: 16843008
Loading config.ocio
** General **
Search Path:
Working Dir: /foo/bar
Default Display:
Default View:
** Roles **
ERROR: NOT DEFINED (default)
ERROR: NOT DEFINED (scene_linear)
ERROR: NOT DEFINED (data)
ERROR: NOT DEFINED (reference)
ERROR: NOT DEFINED (compositing_log)
ERROR: NOT DEFINED (color_timing)
ERROR: NOT DEFINED (color_picking)
ERROR: NOT DEFINED (texture_paint)
ERROR: NOT DEFINED (matte_paint)
** ColorSpaces **
Error: scene_linear role must be defined.
** Looks **
no looks defined
** Sanity Check **
ERROR
Config failed sanitycheck. No displays are specified.
11 tests failed.
```
With respect,
TJS
A v2 config must specify a default color space, but this could either be done using the default role or a default file rule. So if the config does not use file rules, then yes, the default role is required.Hmmm, what would you guys think about adding a getDefaultColorspace() function to match and getDefaultDisplay() and getDefaultView() functions?
Brendan
That's a good suggestion Brendan, we will look into adding that.
And as Troy wrote, ociocheck does in fact throw an error if the following roles are not present:
OCIO::ROLE_DEFAULT, OCIO::ROLE_SCENE_LINEAR, OCIO::ROLE_DATA, OCIO::ROLE_REFERENCE, OCIO::ROLE_COMPOSITING_LOG, OCIO::ROLE_COLOR_TIMING, OCIO::ROLE_COLOR_PICKING, OCIO::ROLE_TEXTURE_PAINT, OCIO::ROLE_MATTE_PAINT
However, once the DisplayTransform refactor is completed (as discussed at the previous working group meeting), none of these will actually be required for the proper operation of the core library. So the ociocheck is basically only enforcing this for the benefit of various apps/plug-ins that may want to rely on those roles being present.
Doug
OCIO::ROLE_DEFAULT, OCIO::ROLE_SCENE_LINEAR, OCIO::ROLE_DATA, OCIO::ROLE_REFERENCE, OCIO::ROLE_COMPOSITING_LOG, OCIO::ROLE_COLOR_TIMING, OCIO::ROLE_COLOR_PICKING, OCIO::ROLE_TEXTURE_PAINT, OCIO::ROLE_MATTE_PAINT
However, once the DisplayTransform refactor is completed (as discussed at the previous working group meeting), none of these will actually be required for the proper operation of the core library. So the ociocheck is basically only enforcing this for the benefit of various apps/plug-ins that may want to rely on those roles being present.