Get ColorSpace

Hi,
How can I query ColorSpace for current source from RV’s python API?
Is this information stored on the RVColor node? Or where can I find it?

Many thanks,
Anders

Hi

We found a solution to get selected colorspace. Pasting it below.
Had to trial and error our way to find property type values. (to choose between getIntProperty, getFloatProperty, etc…) Couldn’t find anything about it in documentation.

Also please let me know if you have any suggestions to improve this method.

def getColorSpace(self):
        
colorspace = "linear"
        # Returning Nuke style colorspace
        # Property types: 1 = float, 2 = int, 8 = string
        # int, int, int, float
        # Gives a list of 1 element so we use [0] to get the first one (the value)
        # We are getting the values for logtype, sRGB2Linear, Rec709ToLinear & Gamma
        nLogtype = commands.getIntProperty("sourceGroup000000_tolinPipeline_0.color.logtype")[0]
        nRGB2Lin = commands.getIntProperty("sourceGroup000000_tolinPipeline_0.color.sRGB2linear")[0]
        nRec2Lin = commands.getIntProperty("sourceGroup000000_tolinPipeline_0.color.Rec709ToLinear")[0]
        fGamma22 = round(commands.getFloatProperty("sourceGroup000000_tolinPipeline_0.color.fileGamma")[0], 1)

        if fGamma22 == 2.2:
            colorspace = "Gamma2.2"
        elif nLogtype == 1:
            colorspace = "Cineon"
        elif nLogtype == 2:
            colorspace = "ViperLog"
        elif nLogtype == 3 or nLogtype == 4:
            colorspace = "AlexaV3LogC"
        elif nLogtype == 6 or nLogtype == 7:
            colorspace = "REDLog"
        elif nLogtype == 0 and nRGB2Lin == 1:
            colorspace = "sRGB"
        elif nLogtype == 0 and nRec2Lin == 1:
            colorspace = "rec709"

        return colorspace