AYON: 3rd party addon usage (#5300)

* implemented helper functions to get ffmpeg and oiio tool arguments

* modified validation functions to be able to handle list of arguments

* path getters can return a path in AYON mode if one argument is returned

* removed test exception

* modified docstrings

* is_oiio_supported is using new functions to get launch arguments

* new functions are in lib public =

* use new functions all over the place

* renamed 'ffmpeg_path' to 'ffmpeg_args'

* raise 'ToolNotFoundError' if tool argument could not be found

* reraise 'KnownPublishError' in publish plugins

* fix comment

* simplify args start

* ffmpeg and oiio function require tool name and support additional arguments

* renamed 'get_oiio_tools_args' to 'get_oiio_tool_args'

* fix variable name
This commit is contained in:
Jakub Trllo 2023-07-27 10:54:45 +02:00 committed by GitHub
parent 7b5e716147
commit d63aa34a76
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 302 additions and 198 deletions

View file

@ -15,8 +15,14 @@ import pyblish.api
from maya import cmds # noqa
from openpype.lib.vendor_bin_utils import find_executable
from openpype.lib import source_hash, run_subprocess, get_oiio_tools_path
from openpype.lib import (
find_executable,
source_hash,
run_subprocess,
get_oiio_tool_args,
ToolNotFoundError,
)
from openpype.pipeline import legacy_io, publish, KnownPublishError
from openpype.hosts.maya.api import lib
@ -267,12 +273,11 @@ class MakeTX(TextureProcessor):
"""
maketx_path = get_oiio_tools_path("maketx")
if not maketx_path:
raise AssertionError(
"OIIO 'maketx' tool not found. Result: {}".format(maketx_path)
)
try:
maketx_args = get_oiio_tool_args("maketx")
except ToolNotFoundError:
raise KnownPublishError(
"OpenImageIO is not available on the machine")
# Define .tx filepath in staging if source file is not .tx
fname, ext = os.path.splitext(os.path.basename(source))
@ -328,8 +333,7 @@ class MakeTX(TextureProcessor):
self.log.info("Generating .tx file for %s .." % source)
subprocess_args = [
maketx_path,
subprocess_args = maketx_args + [
"-v", # verbose
"-u", # update mode
# --checknan doesn't influence the output file but aborts the