no function in (Python) API to get colorspace of defined role?

Skip to first unread message

Abraham Schneider

May 28, 2018, 10:21:14 AM5/28/18
to OpenColorIO Developers
Just had a look in the Python API and wondered how I could get the referenced colorspace of a named role. Some of the roles are predfined as constants (OCIO.Constants.ROLE_...), but what's with user defined roles? So for example the compositing_linear one in the ACES config, or a self defined one?

Shouldn't there be just an easy function like 'getRole(rolename)' that just gives back the name of the colorspace that the role is linking to!?

Really confused at the moment on how to use roles via API.


Sean Cooper

May 28, 2018, 10:39:02 AM5/28/18
Not at a computer to verify, but I believe you can just do a getColorspace() call using the user defined or default roles, the query the name of the returned object. Role names are equivalent to color space names. Its a bit obtuse I must admit.

You received this message because you are subscribed to the Google Groups "OpenColorIO Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
For more options, visit

Abraham Schneider

May 28, 2018, 10:55:41 AM5/28/18
to OpenColorIO Developers
Seems to work, thanks. Not quite obvious from the documentation, especially if you only look at the API docs and not the user guide first.
Reply all
Reply to author
0 new messages