Skip to content

pipeline

Basic AYON integration

FlameHost

Bases: HostBase, ILoadHost, IPublishHost

Source code in client/ayon_flame/api/pipeline.py
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
class FlameHost(HostBase, ILoadHost, IPublishHost):
    name = "flame"

    def __init__(self):
        super().__init__()
        self._publish_context_data = {}

    def get_containers(self):
        return ls()

    def install(self):
        """Install all requirements for Flame host"""
        install()

    def get_context_data(self):
        return deepcopy(self._publish_context_data)

    def update_context_data(self, data, changes):
        self._publish_context_data = deepcopy(data)

install()

Install all requirements for Flame host

Source code in client/ayon_flame/api/pipeline.py
48
49
50
def install(self):
    """Install all requirements for Flame host"""
    install()

containerise(flame_clip_segment, name, namespace, context, loader=None, data=None)

Containerise a flame clip segment.

Source code in client/ayon_flame/api/pipeline.py
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
def containerise(flame_clip_segment,
                 name,
                 namespace,
                 context,
                 loader=None,
                 data=None):
    """ Containerise a flame clip segment.
    """
    data_imprint = {
        "schema": "ayon:container-3.0",
        "id": AYON_CONTAINER_ID,
        "name": str(name),
        "namespace": str(namespace),
        "loader": str(loader),
        "representation": context["representation"]["id"],
    }

    if data:
        data_imprint.update(data)

    # timeline item imprinted data
    set_segment_data_marker(flame_clip_segment, data_imprint)

    return True

imprint(item, data=None)

Adding AYON data to Flame timeline segment.

Also including publish attribute into tag.

Parameters:

Name Type Description Default
item PySegment | PyClip

flame api object

required
data dict

Any data which needs to be imprinted

None

Examples:

data = { 'asset': 'sq020sh0280', 'productType': 'render', 'productName': 'productMain' }

Source code in client/ayon_flame/api/pipeline.py
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
def imprint(item, data=None):
    """
    Adding AYON data to Flame timeline segment.

    Also including publish attribute into tag.

    Arguments:
        item (flame.PySegment | flame.PyClip): flame api object
        data (dict): Any data which needs to be imprinted

    Examples:
        data = {
            'asset': 'sq020sh0280',
            'productType': 'render',
            'productName': 'productMain'
        }
    """
    data = data or {}

    if isinstance(item, flame.PySegment):
        set_segment_data_marker(item, data)
    elif isinstance(item, flame.PyClip):
        set_clip_data_marker(item, data)
    else:
        raise TypeError("Unsupported item type: {}".format(type(item)))

list_instances()

List all created instances from current workfile.

Source code in client/ayon_flame/api/pipeline.py
128
129
130
def list_instances():
    """List all created instances from current workfile."""
    log.debug("TODO: list_instances")

ls()

List available containers.

Source code in client/ayon_flame/api/pipeline.py
105
106
107
108
def ls():
    """List available containers.
    """
    return []  # TODO implement this from metadata

parse_container(tl_segment, validate=True)

Return container data from timeline_item's AYON tag.

Source code in client/ayon_flame/api/pipeline.py
111
112
113
114
def parse_container(tl_segment, validate=True):
    """Return container data from timeline_item's AYON tag.
    """
    log.debug("TODO: parse_container")

remove_instance(instance)

Remove instance marker from track item.

Source code in client/ayon_flame/api/pipeline.py
123
124
125
def remove_instance(instance):
    """Remove instance marker from track item."""
    log.debug("TODO: remove_instance")

update_container(tl_segment, data=None)

Update container data to input timeline_item's AYON tag.

Source code in client/ayon_flame/api/pipeline.py
117
118
119
120
def update_container(tl_segment, data=None):
    """Update container data to input timeline_item's AYON tag.
    """
    log.debug("TODO: update_container")