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 1/8] =?UTF-8?q?=F0=9F=AA=B2=20get=20the=20correct=20templa?= =?UTF-8?q?te=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") From 68e19f4184dd9835df1dda49417da2bd8118a64f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Samohel?= Date: Thu, 16 Oct 2025 18:55:04 +0200 Subject: [PATCH 2/8] =?UTF-8?q?=F0=9F=90=95=20fix=20linting=20issues?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/ayon_core/plugins/publish/collect_resources_path.py | 1 - 1 file changed, 1 deletion(-) diff --git a/client/ayon_core/plugins/publish/collect_resources_path.py b/client/ayon_core/plugins/publish/collect_resources_path.py index e410303a2a..11e378ce52 100644 --- a/client/ayon_core/plugins/publish/collect_resources_path.py +++ b/client/ayon_core/plugins/publish/collect_resources_path.py @@ -82,7 +82,6 @@ class CollectResourcesPath(pyblish.api.InstancePlugin): # TODO remove when all clients have solved this issue template_data.update({"frame": "FRAME_TEMP", "representation": "TEMP"}) - template_name = get_publish_template_name( project_name=template_data["project"]["name"], host_name=get_current_host_name(), From d99075fed6e2186326aa8eb772b9480c8490a00f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Samohel?= Date: Fri, 17 Oct 2025 11:39:42 +0200 Subject: [PATCH 3/8] =?UTF-8?q?=E2=99=BB=EF=B8=8Fuse=20collected=20data=20?= =?UTF-8?q?instead?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/ayon_core/plugins/publish/collect_resources_path.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/ayon_core/plugins/publish/collect_resources_path.py b/client/ayon_core/plugins/publish/collect_resources_path.py index 11e378ce52..2ef3ffe61d 100644 --- a/client/ayon_core/plugins/publish/collect_resources_path.py +++ b/client/ayon_core/plugins/publish/collect_resources_path.py @@ -84,7 +84,7 @@ class CollectResourcesPath(pyblish.api.InstancePlugin): template_name = get_publish_template_name( project_name=template_data["project"]["name"], - host_name=get_current_host_name(), + host_name=instance.context.data["hostName"], product_type=template_data["product"]["type"], task_name=template_data["product"]["name"], task_type=template_data["product"]["type"], From fd5a5a2142437d264d404456ff990951876ff69d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Samohel?= Date: Fri, 17 Oct 2025 11:40:18 +0200 Subject: [PATCH 4/8] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20and=20remove=20unneces?= =?UTF-8?q?sary=20import?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/ayon_core/plugins/publish/collect_resources_path.py | 1 - 1 file changed, 1 deletion(-) diff --git a/client/ayon_core/plugins/publish/collect_resources_path.py b/client/ayon_core/plugins/publish/collect_resources_path.py index 2ef3ffe61d..fc8d3d15cd 100644 --- a/client/ayon_core/plugins/publish/collect_resources_path.py +++ b/client/ayon_core/plugins/publish/collect_resources_path.py @@ -14,7 +14,6 @@ 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): From fe7adf36e689b4fcc87544d91f3987f6ad63e929 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Samohel?= Date: Fri, 17 Oct 2025 11:44:33 +0200 Subject: [PATCH 5/8] =?UTF-8?q?=F0=9F=AA=B2=20fix=20task=20and=20product?= =?UTF-8?q?=20type?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plugins/publish/collect_resources_path.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/client/ayon_core/plugins/publish/collect_resources_path.py b/client/ayon_core/plugins/publish/collect_resources_path.py index fc8d3d15cd..30fe5c0c80 100644 --- a/client/ayon_core/plugins/publish/collect_resources_path.py +++ b/client/ayon_core/plugins/publish/collect_resources_path.py @@ -81,12 +81,18 @@ class CollectResourcesPath(pyblish.api.InstancePlugin): # TODO remove when all clients have solved this issue template_data.update({"frame": "FRAME_TEMP", "representation": "TEMP"}) + task_name = task_type = None + task_entity = instance.data.get("taskEntity") + if task_entity: + task_name = task_entity.name + task_type = task_entity.type + template_name = get_publish_template_name( project_name=template_data["project"]["name"], host_name=instance.context.data["hostName"], - product_type=template_data["product"]["type"], - task_name=template_data["product"]["name"], - task_type=template_data["product"]["type"], + product_type=instance.data["productType"], + task_name=task_name, + task_type=task_type, project_settings=instance.context.data["project_settings"], logger=self.log, ) From c49d92c30668df40a620218fce2c8991973d1d51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Samohel?= Date: Fri, 17 Oct 2025 11:46:48 +0200 Subject: [PATCH 6/8] =?UTF-8?q?=F0=9F=A6=97=20fix=20data=20access?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/ayon_core/plugins/publish/collect_resources_path.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/ayon_core/plugins/publish/collect_resources_path.py b/client/ayon_core/plugins/publish/collect_resources_path.py index 30fe5c0c80..927e358ea7 100644 --- a/client/ayon_core/plugins/publish/collect_resources_path.py +++ b/client/ayon_core/plugins/publish/collect_resources_path.py @@ -84,8 +84,8 @@ class CollectResourcesPath(pyblish.api.InstancePlugin): task_name = task_type = None task_entity = instance.data.get("taskEntity") if task_entity: - task_name = task_entity.name - task_type = task_entity.type + task_name = task_entity["name"] + task_type = task_entity["task_type"] template_name = get_publish_template_name( project_name=template_data["project"]["name"], From df8459bbabf81d26c6b15d47dce3a66eb22c7de5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Samohel?= Date: Fri, 17 Oct 2025 11:47:57 +0200 Subject: [PATCH 7/8] =?UTF-8?q?=F0=9F=A6=97=20fix=20key=20name?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/ayon_core/plugins/publish/collect_resources_path.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/ayon_core/plugins/publish/collect_resources_path.py b/client/ayon_core/plugins/publish/collect_resources_path.py index 927e358ea7..07cae07a3f 100644 --- a/client/ayon_core/plugins/publish/collect_resources_path.py +++ b/client/ayon_core/plugins/publish/collect_resources_path.py @@ -85,7 +85,7 @@ class CollectResourcesPath(pyblish.api.InstancePlugin): task_entity = instance.data.get("taskEntity") if task_entity: task_name = task_entity["name"] - task_type = task_entity["task_type"] + task_type = task_entity["taskType"] template_name = get_publish_template_name( project_name=template_data["project"]["name"], From 34594f7ee4deddcf7cb58efab05311b8c66d14b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Samohel?= <33513211+antirotor@users.noreply.github.com> Date: Fri, 17 Oct 2025 14:12:58 +0200 Subject: [PATCH 8/8] Apply suggestion from @iLLiCiTiT Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> --- client/ayon_core/plugins/publish/collect_resources_path.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/ayon_core/plugins/publish/collect_resources_path.py b/client/ayon_core/plugins/publish/collect_resources_path.py index 07cae07a3f..704c69a6ab 100644 --- a/client/ayon_core/plugins/publish/collect_resources_path.py +++ b/client/ayon_core/plugins/publish/collect_resources_path.py @@ -88,7 +88,7 @@ class CollectResourcesPath(pyblish.api.InstancePlugin): task_type = task_entity["taskType"] template_name = get_publish_template_name( - project_name=template_data["project"]["name"], + project_name=instance.context.data["projectName"], host_name=instance.context.data["hostName"], product_type=instance.data["productType"], task_name=task_name,