Required Roles


Brendan Bolles
 

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


Troy Sobotka <troy.sobotka@...>
 

On Mon, May 11, 2020 at 12:12 PM Brendan Bolles <brendan@...> wrote:
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?


The ociocheck tool and the sanity check API should flag missing default roles.

With respect,
TJS


Doug Walker
 

> 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

 


Troy Sobotka <troy.sobotka@...>
 

On Mon, May 11, 2020 at 3:36 PM Doug Walker <doug.walker@...> wrote:

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.
ociocheck and sanity check should abide by the following
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


Brendan Bolles
 

On Mon, May 11, 2020 at 03:36 PM, Doug Walker wrote:
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


Doug Walker
 

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

 


Troy Sobotka <troy.sobotka@...>
 



On Mon, May 11, 2020 at 10:24 PM Doug Walker <doug.walker@...> wrote:

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.


I am hoping that some bedrock aliases will remain in the event that a configuration is added and reconciliation cannot be made in a DCC.

Without aliases, the whole system would have to revert to hard coded transforms, which is of course ghastly.

Data, working space / scene linear, and a few others are vital in this regard.

With respect,
TJS