Skip to content

collect_audio

CollectAudio

Bases: ContextPlugin

Inject audio file url for rendered composition into context. Needs to run AFTER 'collect_render'. Use collected comp_id to check if there is an AVLayer in this composition

Source code in client/ayon_aftereffects/plugins/publish/collect_audio.py
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
class CollectAudio(pyblish.api.ContextPlugin):
    """Inject audio file url for rendered composition into context.
        Needs to run AFTER 'collect_render'. Use collected comp_id to check
        if there is an AVLayer in this composition
    """

    order = pyblish.api.CollectorOrder + 0.499
    label = "Collect Audio"
    hosts = ["aftereffects"]

    def process(self, context):
        for instance in context:
            if 'render.farm' in instance.data.get("families", []):
                comp_id = instance.data["comp_id"]
                if not comp_id:
                    self.log.debug("No comp_id filled in instance")
                    continue
                context.data["audioFile"] = os.path.normpath(
                    get_stub().get_audio_url(comp_id)
                ).replace("\\", "/")