From 28978f07c654446c3af3b64e54cc93bff879bd56 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Thu, 12 Jun 2025 15:50:21 +0200 Subject: [PATCH] use standard conditions --- client/ayon_core/lib/transcoding.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/client/ayon_core/lib/transcoding.py b/client/ayon_core/lib/transcoding.py index 97e9f417f0..01a21615b5 100644 --- a/client/ayon_core/lib/transcoding.py +++ b/client/ayon_core/lib/transcoding.py @@ -1134,19 +1134,13 @@ def oiio_color_convert( ]) # Validate input parameters - if all([target_colorspace, target_view, target_display]): + if target_colorspace and target_view and target_display: raise ValueError( "Colorspace and both screen and display cannot be set together." "Choose colorspace or screen and display" ) - if all([source_view, source_display]) and source_colorspace: - logger.warning( - "Both source display/view and source_colorspace provided. " - "Using source display/view pair and ignoring source_colorspace." - ) - - if not target_colorspace and not all([target_view, target_display]): + if not target_colorspace and not target_view and not target_display: raise ValueError( "Both screen and display must be set if target_colorspace is not " "provided." @@ -1161,6 +1155,12 @@ def oiio_color_convert( "display/view inputs." ) + if source_view and source_display and source_colorspace: + logger.warning( + "Both source display/view and source_colorspace provided. " + "Using source display/view pair and ignoring source_colorspace." + ) + if additional_command_args: oiio_cmd.extend(additional_command_args)