Skip to content

extract_compositions

ExtractSaveScene

Bases: InstancePlugin

Collects all compositions contained in workfile.

Used later in Premiere to choose which composition to load.

Source code in client/ayon_aftereffects/plugins/publish/extract_compositions.py
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
class ExtractSaveScene(pyblish.api.InstancePlugin):
    """Collects all compositions contained in workfile.

    Used later in Premiere to choose which composition to load.
    """

    order = publish.Extractor.order
    label = "Extract Compositions"
    hosts = ["aftereffects"]
    families = ["workfile"]

    def process(self, instance):
        stub = get_stub()
        representation = instance.data["representations"][0]

        comp_items =  stub.get_items(
            comps=True,
            folders=False,
            footages=False
        )
        if "data" not in representation:
            representation["data"] = {}
        data = {
            "composition_names_in_workfile": [item.name for item in comp_items]
        }
        representation["data"].update(data)