mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
render wasn't working without audio
This commit is contained in:
parent
c73d234c5d
commit
fc27d6d2df
2 changed files with 53 additions and 7 deletions
|
|
@ -111,13 +111,22 @@ class ExtractRender(pyblish.api.InstancePlugin):
|
|||
|
||||
# Generate mov.
|
||||
mov_path = os.path.join(path, instance.data["name"] + ".mov")
|
||||
args = [
|
||||
"ffmpeg", "-y",
|
||||
"-i", audio_path,
|
||||
"-i",
|
||||
os.path.join(path, collection.head + "%04d" + collection.tail),
|
||||
mov_path
|
||||
]
|
||||
if os.path.isfile(audio_path):
|
||||
args = [
|
||||
"ffmpeg", "-y",
|
||||
"-i", audio_path,
|
||||
"-i",
|
||||
os.path.join(path, collection.head + "%04d" + collection.tail),
|
||||
mov_path
|
||||
]
|
||||
else:
|
||||
args = [
|
||||
"ffmpeg", "-y",
|
||||
"-i",
|
||||
os.path.join(path, collection.head + "%04d" + collection.tail),
|
||||
mov_path
|
||||
]
|
||||
|
||||
process = subprocess.Popen(
|
||||
args,
|
||||
stdout=subprocess.PIPE,
|
||||
|
|
|
|||
37
pype/plugins/harmony/publish/validate_audio.py
Normal file
37
pype/plugins/harmony/publish/validate_audio.py
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
import json
|
||||
import os
|
||||
|
||||
import pyblish.api
|
||||
|
||||
import avalon.harmony
|
||||
import pype.hosts.harmony
|
||||
|
||||
|
||||
class ValidateAudio(pyblish.api.InstancePlugin):
|
||||
"""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"]
|
||||
optional = True
|
||||
|
||||
def process(self, instance):
|
||||
# Collect scene data.
|
||||
func = """function func(write_node)
|
||||
{
|
||||
return [
|
||||
sound.getSoundtrackAll().path()
|
||||
]
|
||||
}
|
||||
func
|
||||
"""
|
||||
result = avalon.harmony.send(
|
||||
{"function": func, "args": [instance[0]]}
|
||||
)["result"]
|
||||
|
||||
audio_path = result[0]
|
||||
|
||||
msg = "You are missing audio file:\n{}".format(audio_path)
|
||||
|
||||
assert os.path.isfile(audio_path), msg
|
||||
Loading…
Add table
Add a link
Reference in a new issue