From ca59ad7bf740f1ddc34f19e4670bbd951e37a84c Mon Sep 17 00:00:00 2001 From: jakubjezek001 Date: Thu, 18 Dec 2025 10:05:35 +0100 Subject: [PATCH 1/2] Add review family when review representation is added Ensures that instances with added review representations are properly tagged with the "review" family for downstream processing. --- client/ayon_core/plugins/publish/extract_color_transcode.py | 6 ++++++ 1 file changed, 6 insertions(+) mode change 100644 => 100755 client/ayon_core/plugins/publish/extract_color_transcode.py diff --git a/client/ayon_core/plugins/publish/extract_color_transcode.py b/client/ayon_core/plugins/publish/extract_color_transcode.py old mode 100644 new mode 100755 index 63a73e07fa..b13a41b090 --- a/client/ayon_core/plugins/publish/extract_color_transcode.py +++ b/client/ayon_core/plugins/publish/extract_color_transcode.py @@ -279,6 +279,12 @@ class ExtractOIIOTranscode(publish.Extractor): if "delete" in tags and "thumbnail" not in tags: instance.data["representations"].remove(repre) + if ( + added_review + and "review" not in instance.data["families"] + ): + instance.data["families"].append("review") + instance.data["representations"].extend(new_representations) def _rename_in_representation(self, new_repre, files_to_convert, From ae5eea56fe12122968c981ee0b6afd95ef8c8d5b Mon Sep 17 00:00:00 2001 From: jakubjezek001 Date: Thu, 18 Dec 2025 10:10:48 +0100 Subject: [PATCH 2/2] Add representation name filtering to OIIO transcode Adds support for filtering which representations to transcode based on regex patterns. The profile now accepts a list of representation name patterns, and only matching representations will be processed. If no patterns are specified, all representations are processed. --- .../publish/extract_color_transcode.py | 23 ++++++++++++++++--- server/settings/publish_plugins.py | 4 ++++ 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/client/ayon_core/plugins/publish/extract_color_transcode.py b/client/ayon_core/plugins/publish/extract_color_transcode.py index b13a41b090..5c43ef10dc 100755 --- a/client/ayon_core/plugins/publish/extract_color_transcode.py +++ b/client/ayon_core/plugins/publish/extract_color_transcode.py @@ -1,4 +1,5 @@ import os +import re import copy import clique import pyblish.api @@ -101,7 +102,7 @@ class ExtractOIIOTranscode(publish.Extractor): for idx, repre in enumerate(list(repres)): self.log.debug("repre ({}): `{}`".format(idx + 1, repre["name"])) - if not self._repre_is_valid(repre): + if not self._repre_is_valid(repre, profile): continue added_representations = False @@ -382,7 +383,7 @@ class ExtractOIIOTranscode(publish.Extractor): return profile - def _repre_is_valid(self, repre): + def _repre_is_valid(self, repre, profile): """Validation if representation should be processed. Args: @@ -409,7 +410,23 @@ class ExtractOIIOTranscode(publish.Extractor): "Skipped.".format(repre["name"])) return False - return True + representations = profile["representations"] + repre_name = repre["name"] + + # make sure if not representations than it will return True + result = [True] + + # check if any of representation patterns match in repre_name + if representations: + result = [] + for r_pattern in representations: + if re.match(r_pattern, repre_name): + result.append(True) + break + else: + result.append(False) + + return any(result) def _mark_original_repre_for_deletion(self, repre, profile, added_review): """If new transcoded representation created, delete old.""" diff --git a/server/settings/publish_plugins.py b/server/settings/publish_plugins.py index d7b794cb5b..e508b5498f 100644 --- a/server/settings/publish_plugins.py +++ b/server/settings/publish_plugins.py @@ -556,6 +556,10 @@ class ExtractOIIOTranscodeProfileModel(BaseSettingsModel): default_factory=list, title="Product names" ) + representations: list[str] = SettingsField( + default_factory=list, + title="Representation names" + ) delete_original: bool = SettingsField( True, title="Delete Original Representation",