From fd1b3b0e64ea1516139608659ee9b013f82d372f Mon Sep 17 00:00:00 2001 From: TobiasPharos Date: Thu, 2 Oct 2025 11:22:25 +0200 Subject: [PATCH 1/3] fix for "replace_with_published_scene_path" Published scene file has to be of productType/family "workfile" --- client/ayon_core/pipeline/publish/lib.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/client/ayon_core/pipeline/publish/lib.py b/client/ayon_core/pipeline/publish/lib.py index 1f983808b0..3756746ee9 100644 --- a/client/ayon_core/pipeline/publish/lib.py +++ b/client/ayon_core/pipeline/publish/lib.py @@ -812,7 +812,20 @@ def replace_with_published_scene_path(instance, replace_in_path=True): template_data["comment"] = None anatomy = instance.context.data["anatomy"] - template = anatomy.get_template_item("publish", "default", "path") + project_name = anatomy.project_name + task_entity = instance.data.get("taskEntity", {}) + project_settings = get_project_settings(project_name) + template_name = get_publish_template_name( + project_name=project_name, + host_name=instance.context.data.get("hostName", os.environ["AYON_HOST_NAME"]), + # publish template has to match productType "workfile", + # otherwise default template will be used: + product_type="workfile", + task_name=task_entity.get("name", os.environ["AYON_TASK_NAME"]), + task_type=task_entity.get("taskType"), + project_settings=project_settings, + ) + template = anatomy.get_template_item("publish", template_name, "path") template_filled = template.format_strict(template_data) file_path = os.path.normpath(template_filled) From 81fb1e73c4f5c4776ad133e7ad488afea54ea973 Mon Sep 17 00:00:00 2001 From: Ondrej Samohel Date: Fri, 17 Oct 2025 14:14:52 +0200 Subject: [PATCH 2/3] handle project settings and task entity --- client/ayon_core/pipeline/publish/lib.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/client/ayon_core/pipeline/publish/lib.py b/client/ayon_core/pipeline/publish/lib.py index 3756746ee9..555f4b1894 100644 --- a/client/ayon_core/pipeline/publish/lib.py +++ b/client/ayon_core/pipeline/publish/lib.py @@ -813,16 +813,20 @@ def replace_with_published_scene_path(instance, replace_in_path=True): anatomy = instance.context.data["anatomy"] project_name = anatomy.project_name - task_entity = instance.data.get("taskEntity", {}) - project_settings = get_project_settings(project_name) + task_name = task_type = None + task_entity = instance.data.get("taskEntity") + if task_entity: + task_name = task_entity["name"] + task_type = task_entity["taskType"] + project_settings = instance.context.data["project_settings"] template_name = get_publish_template_name( project_name=project_name, - host_name=instance.context.data.get("hostName", os.environ["AYON_HOST_NAME"]), + host_name=instance.context.data["hostName"], # publish template has to match productType "workfile", # otherwise default template will be used: product_type="workfile", - task_name=task_entity.get("name", os.environ["AYON_TASK_NAME"]), - task_type=task_entity.get("taskType"), + task_name=task_name, + task_type=task_type, project_settings=project_settings, ) template = anatomy.get_template_item("publish", template_name, "path") From c33795b68a6d6bd374428c07e623a23e99861a45 Mon Sep 17 00:00:00 2001 From: TobiasPharos Date: Tue, 25 Nov 2025 10:07:18 +0100 Subject: [PATCH 3/3] get product_type from workfile instance --- client/ayon_core/pipeline/publish/lib.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/client/ayon_core/pipeline/publish/lib.py b/client/ayon_core/pipeline/publish/lib.py index 555f4b1894..2187ef0304 100644 --- a/client/ayon_core/pipeline/publish/lib.py +++ b/client/ayon_core/pipeline/publish/lib.py @@ -822,9 +822,7 @@ def replace_with_published_scene_path(instance, replace_in_path=True): template_name = get_publish_template_name( project_name=project_name, host_name=instance.context.data["hostName"], - # publish template has to match productType "workfile", - # otherwise default template will be used: - product_type="workfile", + product_type=workfile_instance.data["productType"], task_name=task_name, task_type=task_type, project_settings=project_settings,