From e356630f4d94428828f14898a70ecc3c70619b8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Samohel?= Date: Thu, 16 Oct 2025 17:19:41 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=AA=B2=20get=20the=20correct=20template?= =?UTF-8?q?=20for=20resources?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plugins/publish/collect_resources_path.py | 25 +++++++++++++------ 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/client/ayon_core/plugins/publish/collect_resources_path.py b/client/ayon_core/plugins/publish/collect_resources_path.py index 2e5b296228..e410303a2a 100644 --- a/client/ayon_core/plugins/publish/collect_resources_path.py +++ b/client/ayon_core/plugins/publish/collect_resources_path.py @@ -13,6 +13,9 @@ import copy import pyblish.api +from ayon_core.pipeline.publish import get_publish_template_name +from ayon_core.pipeline.context_tools import get_current_host_name + class CollectResourcesPath(pyblish.api.InstancePlugin): """Generate directory path where the files and resources will be stored. @@ -77,16 +80,24 @@ class CollectResourcesPath(pyblish.api.InstancePlugin): # This is for cases of Deprecated anatomy without `folder` # TODO remove when all clients have solved this issue - template_data.update({ - "frame": "FRAME_TEMP", - "representation": "TEMP" - }) + template_data.update({"frame": "FRAME_TEMP", "representation": "TEMP"}) - publish_templates = anatomy.get_template_item( - "publish", "default", "directory" + + template_name = get_publish_template_name( + project_name=template_data["project"]["name"], + host_name=get_current_host_name(), + product_type=template_data["product"]["type"], + task_name=template_data["product"]["name"], + task_type=template_data["product"]["type"], + project_settings=instance.context.data["project_settings"], + logger=self.log, ) + + publish_template = anatomy.get_template_item( + "publish", template_name, "directory") + publish_folder = os.path.normpath( - publish_templates.format_strict(template_data) + publish_template.format_strict(template_data) ) resources_folder = os.path.join(publish_folder, "resources")