Skip to content

pipeline

Pipeline tools for AYON motionbuilder integration.

ls()

Get all AYON containers.

Source code in client/ayon_motionbuilder/api/pipeline.py
126
127
128
129
130
131
132
133
134
135
def ls():
    """Get all AYON containers."""
    containers = []
    for obj_sets in FBSystem().Scene.Sets:
        for prop in obj_sets.PropertyList:
            if prop.GetName() == "containers":
                    containers.append(obj_sets)

    for container in sorted(containers, key=attrgetter("Name")):
        yield parse_container(container)

parse_container(container)

Return the container node's full container data.

Parameters:

Name Type Description Default
container str

A container node name.

required

Returns:

Name Type Description
dict

The container schema data for this container node.

Source code in client/ayon_motionbuilder/api/pipeline.py
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
def parse_container(container):
    """Return the container node's full container data.

    Args:
        container (str): A container node name.

    Returns:
        dict: The container schema data for this container node.

    """
    data = lib.read(container)

    # Backwards compatibility pre-schemas for containers
    data["schema"] = data.get("schema", "openpype:container-3.0")

    # Append transient data
    data["objectName"] = container.Name
    return data