Skip to content

colorspace

ARenderProduct

Bases: object

Source code in client/ayon_max/api/colorspace.py
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
class ARenderProduct(object):

    def __init__(self, frame_start, frame_end):
        """Constructor."""
        # Initialize
        self.layer_data = self._get_layer_data(frame_start, frame_end)

    def _get_layer_data(
        self,
        frame_start: int,
        frame_end: int
    ) -> LayerMetadata:
        return LayerMetadata(
            frameStart=int(frame_start),
            frameEnd=int(frame_end),
        )


    def add_colorspace_data(
        self,
        product_name: str,
        colorspace: str,
        view: str,
        display: str
    ) -> None:
        """Add colorspace data to the render product.

        Args:
            product_name (str): The name of the render product.
            colorspace (str): The colorspace of the render product.
            view (str): The view of the render product.
            display (str): The display of the render product.
        """
        self.layer_data.products.append(RenderProduct(
            productName=product_name,
            colorspace=colorspace,
            view=view,
            display=display
        ))

__init__(frame_start, frame_end)

Constructor.

Source code in client/ayon_max/api/colorspace.py
33
34
35
36
def __init__(self, frame_start, frame_end):
    """Constructor."""
    # Initialize
    self.layer_data = self._get_layer_data(frame_start, frame_end)

add_colorspace_data(product_name, colorspace, view, display)

Add colorspace data to the render product.

Parameters:

Name Type Description Default
product_name str

The name of the render product.

required
colorspace str

The colorspace of the render product.

required
view str

The view of the render product.

required
display str

The display of the render product.

required
Source code in client/ayon_max/api/colorspace.py
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
def add_colorspace_data(
    self,
    product_name: str,
    colorspace: str,
    view: str,
    display: str
) -> None:
    """Add colorspace data to the render product.

    Args:
        product_name (str): The name of the render product.
        colorspace (str): The colorspace of the render product.
        view (str): The view of the render product.
        display (str): The display of the render product.
    """
    self.layer_data.products.append(RenderProduct(
        productName=product_name,
        colorspace=colorspace,
        view=view,
        display=display
    ))

LayerMetadata

Bases: object

Data class for Render Layer metadata.

Source code in client/ayon_max/api/colorspace.py
23
24
25
26
27
28
@attr.s
class LayerMetadata(object):
    """Data class for Render Layer metadata."""
    frameStart = attr.ib()
    frameEnd = attr.ib()
    products: list[RenderProduct] = attr.ib(factory=list)

RenderProduct

Bases: object

Getting Colorspace as Specific Render Product Parameter for submitting publish job.

Source code in client/ayon_max/api/colorspace.py
11
12
13
14
15
16
17
18
19
20
@attr.s
class RenderProduct(object):
    """Getting Colorspace as
    Specific Render Product Parameter for submitting
    publish job.
    """
    productName = attr.ib(default="")
    colorspace = attr.ib(default=None)
    view = attr.ib(default=None)
    display = attr.ib(default=None)