c4d.modules.render.OcioConverter

class c4d.modules.render.OcioConverter

Transforms colors from one OCIO color space to another.

New in version 2025.2.0.

Overview

Color Conversion

OcioConverter.IsOcioConverter()

Checks if the converter is an OCIO converter.

OcioConverter.TransformColor()

Transforms a color.

OcioConverter.TransformColors()

Transforms multiple colors.

Magic Methods

OcioConverter.__init__()

Creates a new converter and Initializes it with the document settings.

Members

Color Conversion

OcioConverter.IsOcioConverter(self)

Checks if the converter is an OCIO converter.

Returns

True if the converter is an OCIO converter, False if the converter is a legacy converter.

Return type

bool

OcioConverter.TransformColor(self, v, colorSpaceTransformation)

Transforms a color.

Parameters
  • v (Union[c4d.Vector, maxon.Vector]) – Input color.

  • colorSpaceTransformation (int.) –

    The values are:

    Symbol ID

    Description

    NONE

    None.

    COLORSPACETRANSFORMATION_LINEAR_TO_SRGB

    Linear to sRGB color space transformation.

    COLORSPACETRANSFORMATION_SRGB_TO_LINEAR

    sRGB to linear color space transformation.

    COLORSPACETRANSFORMATION_LINEAR_TO_VIEW

    Linear to display color space transformation.

    COLORSPACETRANSFORMATION_SRGB_TO_VIEW

    sRGB to display color space transformation.

Returns

The transformed color.

Return type

c4d.Vector

OcioConverter.TransformColors(self, v, colorSpaceTransformation)

Transforms multiple colors.

Parameters
  • v (Iterator[Union[c4d.Vector, maxon.Vector]]) – Input color.

  • colorSpaceTransformation (int.) –

    The values are:

    Symbol ID

    Description

    NONE

    None.

    COLORSPACETRANSFORMATION_LINEAR_TO_SRGB

    Linear to sRGB color space transformation.

    COLORSPACETRANSFORMATION_SRGB_TO_LINEAR

    sRGB to linear color space transformation.

    COLORSPACETRANSFORMATION_LINEAR_TO_VIEW

    Linear to display color space transformation.

    COLORSPACETRANSFORMATION_SRGB_TO_VIEW

    sRGB to display color space transformation.

Returns

The transformed colors.

Return type

list[c4d.Vector]

Magic Methods

OcioConverter.__init__(self, doc, overrideViewTransform=-1)

Creates a new converter and Initializes it with the document settings.

Parameters
  • doc (c4d.documents.BaseDocument) – The optional document to initialize with.

  • overrideViewTransform (int) – Index within the viewtransform array to override the view transform. Ignored, if the value is not a valid index.