From 9772bf76607106b3f8a563aa0cf1966595993007 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 6 Oct 2020 14:07:52 +0200 Subject: [PATCH] add audio to instance.data only if audio file exists --- pype/plugins/harmony/publish/extract_render.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pype/plugins/harmony/publish/extract_render.py b/pype/plugins/harmony/publish/extract_render.py index 4fd61efbbf..9d3ae33e23 100644 --- a/pype/plugins/harmony/publish/extract_render.py +++ b/pype/plugins/harmony/publish/extract_render.py @@ -45,8 +45,7 @@ class ExtractRender(pyblish.api.InstancePlugin): frame_start = result[4] frame_end = result[5] audio_path = result[6] - if audio_path: - instance.data["audio"] = [{"filename": audio_path}] + instance.data["fps"] = frame_rate # Set output path to temp folder. @@ -139,6 +138,9 @@ class ExtractRender(pyblish.api.InstancePlugin): } instance.data["representations"] = [representation, thumbnail] + if audio_path and os.path.exists(audio_path): + instance.data["audio"] = [{"filename": audio_path}] + # Required for extract_review plugin (L222 onwards). instance.data["frameStart"] = frame_start instance.data["frameEnd"] = frame_end