From a26e575ce01ed9e36ecab74bbae1a81181fd4357 Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Mon, 18 Dec 2023 11:54:45 +0100 Subject: [PATCH] Photoshop: fix layer publish thumbnail missing in loader (#6061) * OP-1645 - explicitly add thumbnail path to be integrated to Ayon Thumbnail representation is set to 'delete', eg wont be integrated, another source of thumbnail must be used. This will effectively limit option of NOT pushing thumbnail to Ayon, which use case I am actuall not seeing. * OP-1645 - added more description * Remove comment It works even for OP. Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> * Update openpype/plugins/publish/integrate_thumbnail_ayon.py Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> * Updates to docstring Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> * Update openpype/plugins/publish/integrate_thumbnail_ayon.py Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> * OP-1645 - fix formatting --------- Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> --- .../photoshop/plugins/publish/extract_review.py | 1 + .../plugins/publish/integrate_thumbnail_ayon.py | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/openpype/hosts/photoshop/plugins/publish/extract_review.py b/openpype/hosts/photoshop/plugins/publish/extract_review.py index d5dac417d7..c2773b2a20 100644 --- a/openpype/hosts/photoshop/plugins/publish/extract_review.py +++ b/openpype/hosts/photoshop/plugins/publish/extract_review.py @@ -224,6 +224,7 @@ class ExtractReview(publish.Extractor): "stagingDir": staging_dir, "tags": ["thumbnail", "delete"] }) + instance.data["thumbnailPath"] = thumbnail_path def _check_and_resize(self, processed_img_names, source_files_pattern, staging_dir): diff --git a/openpype/plugins/publish/integrate_thumbnail_ayon.py b/openpype/plugins/publish/integrate_thumbnail_ayon.py index 1947c9dd4c..fc77a803fc 100644 --- a/openpype/plugins/publish/integrate_thumbnail_ayon.py +++ b/openpype/plugins/publish/integrate_thumbnail_ayon.py @@ -5,7 +5,21 @@ pull into a scene. This one is used only as image describing content of published item and - shows up only in Loader in right column section. + shows up only in Loader or WebUI. + + Instance must have 'published_representations' to + be able to integrate thumbnail. + Possible sources of thumbnail paths: + - instance.data["thumbnailPath"] + - representation with 'thumbnail' name in 'published_representations' + - context.data["thumbnailPath"] + + Notes: + Issue with 'thumbnail' representation is that we most likely don't + want to integrate it as representation. Integrated representation + is polluting Loader and database without real usage. That's why + they usually have 'delete' tag to skip the integration. + """ import os