From 2ae4b12f218cbf82ef15753bcf3b7a388b420ff1 Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Thu, 14 Oct 2021 12:07:13 +0200 Subject: [PATCH 1/2] Fix - oiiotool wasn't recognized even if present This caused to DWAA support not working even if it could --- openpype/lib/plugin_tools.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/openpype/lib/plugin_tools.py b/openpype/lib/plugin_tools.py index 9dccadc44ee..a9829838058 100644 --- a/openpype/lib/plugin_tools.py +++ b/openpype/lib/plugin_tools.py @@ -377,7 +377,7 @@ def oiio_supported(): """ Checks if oiiotool is configured for this platform. - Expects full path to executable. + Triggers simple subprocess, handles exception if fails. 'should_decompress' will throw exception if configured, but not present or not working. @@ -385,7 +385,13 @@ def oiio_supported(): (bool) """ oiio_path = get_oiio_tools_path() - if not oiio_path or not os.path.exists(oiio_path): + if oiio_path: + try: + _ = run_subprocess([oiio_path, "-v"]) + except FileNotFoundError: + oiio_path = None + + if not oiio_path: log.debug("OIIOTool is not configured or not present at {}". format(oiio_path)) return False From a10963188d1aaabdb170540e6d1635409d5829ba Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Thu, 14 Oct 2021 17:32:00 +0200 Subject: [PATCH 2/2] Fix - better approach for oiio_supported --- openpype/lib/plugin_tools.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/openpype/lib/plugin_tools.py b/openpype/lib/plugin_tools.py index a9829838058..4eabb4d1ca1 100644 --- a/openpype/lib/plugin_tools.py +++ b/openpype/lib/plugin_tools.py @@ -6,6 +6,7 @@ import re import json import tempfile +import distutils from .execute import run_subprocess from .profiles_filtering import filter_profiles @@ -386,10 +387,7 @@ def oiio_supported(): """ oiio_path = get_oiio_tools_path() if oiio_path: - try: - _ = run_subprocess([oiio_path, "-v"]) - except FileNotFoundError: - oiio_path = None + oiio_path = distutils.spawn.find_executable(oiio_path) if not oiio_path: log.debug("OIIOTool is not configured or not present at {}".