Skip to content

validate_audio

ValidateAudio

Bases: InstancePlugin, OptionalPyblishPluginMixin

Ensures that there is an audio file in the scene.

If you are sure that you want to send render without audio, you can disable this validator before clicking on "publish"

Source code in client/ayon_harmony/plugins/publish/validate_audio.py
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
class ValidateAudio(
    pyblish.api.InstancePlugin,
    OptionalPyblishPluginMixin,
):
    """Ensures that there is an audio file in the scene.

    If you are sure that you want to send render without audio, you can
    disable this validator before clicking on "publish"
    """

    order = pyblish.api.ValidatorOrder
    label = "Validate Audio"
    families = ["render"]
    hosts = ["harmony"]
    settings_category = "harmony"
    optional = True

    def process(self, instance):
        if not self.is_active(instance.data):
            return

        node = None
        if instance.data.get("setMembers"):
            node = instance.data["setMembers"][0]

        if not node:
            return

        sound_cols = harmony.send(
            {"function": "column.getColumnListOfType", "args": "SOUND"}
        )["result"]

        if not sound_cols:
            raise PublishXmlValidationError(
                self, "No sound file imported in scene."
            )