RV OCIO ColorSpace Automation

Good Afternoon,
I am currently trying to automate RV to the do the following:

if file meta_data contains “ocio: ACEScg”
set current sources → file color space → Active
if file_color_space = active
set current sources → file color space → ACES → ACEScg

I have been working on the ocio_source_setup.py for awhile and have not yet found a solution.
I am able to grab the metadata fine with

def useSourceOCIO(self, source, nodeType, defaultSetting=""):
        """
        This tells the source group to use OCIO instead of the RV
        linearize node. There is also ocio.look and ocio.preCache
        which can be activated in this way. For this code we're
        only assuming that OCIO is going to be used to linearize
        the source.
        """

        medias = commands.getStringProperty("%s.media.movie" % source)
        media = medias[0]

        try:
            srcAttrs = commands.sourceAttributes(source, media)
            attrDict = dict(zip([i[0] for i in srcAttrs], [j[1] for j in srcAttrs]))
            attrDict["source_node"] = source
            attrDict["default_setting"] = defaultSetting
            ocio = attrDict["EXR/ocio"]

Bump!

Hey @deargodrvwhy,

Have you seen the Getting Started With OCIO guide? It’s a quick start and has an example pipeline that might help you visualize the process.

Thanks,
Alexa