diff --git a/openpype/hosts/webpublisher/plugins/publish/collect_batch_data.py b/openpype/hosts/webpublisher/plugins/publish/collect_batch_data.py index 062c5ce0da..ca14538d7d 100644 --- a/openpype/hosts/webpublisher/plugins/publish/collect_batch_data.py +++ b/openpype/hosts/webpublisher/plugins/publish/collect_batch_data.py @@ -59,6 +59,7 @@ class CollectBatchData(pyblish.api.ContextPlugin): context.data["asset"] = asset_name context.data["task"] = task_name context.data["taskType"] = task_type + context.data["project_name"] = project_name self._set_ctx_path(batch_data) diff --git a/openpype/hosts/webpublisher/plugins/publish/collect_published_files.py b/openpype/hosts/webpublisher/plugins/publish/collect_published_files.py index e04f207c01..abad14106f 100644 --- a/openpype/hosts/webpublisher/plugins/publish/collect_published_files.py +++ b/openpype/hosts/webpublisher/plugins/publish/collect_published_files.py @@ -13,8 +13,10 @@ import tempfile from avalon import io import pyblish.api from openpype.lib import prepare_template_data -from openpype.lib.plugin_tools import parse_json - +from openpype.lib.plugin_tools import ( + parse_json, + get_subset_name_with_asset_doc +) class CollectPublishedFiles(pyblish.api.ContextPlugin): """ @@ -47,8 +49,13 @@ class CollectPublishedFiles(pyblish.api.ContextPlugin): self.log.info("task_sub:: {}".format(task_subfolders)) asset_name = context.data["asset"] + asset_doc = io.find_one({ + "type": "asset", + "name": asset_name + }) task_name = context.data["task"] task_type = context.data["taskType"] + project_name = context.data["project_name"] for task_dir in task_subfolders: task_data = parse_json(os.path.join(task_dir, "manifest.json")) @@ -57,20 +64,21 @@ class CollectPublishedFiles(pyblish.api.ContextPlugin): is_sequence = len(task_data["files"]) > 1 _, extension = os.path.splitext(task_data["files"][0]) - family, families, subset_template, tags = self._get_family( + family, families, tags = self._get_family( self.task_type_to_family, task_type, is_sequence, extension.replace(".", '')) - subset = self._get_subset_name( - family, subset_template, task_name, task_data["variant"] + subset_name = get_subset_name_with_asset_doc( + family, task_data["variant"], task_name, asset_doc, + project_name=project_name, host_name="webpublisher" ) - version = self._get_last_version(asset_name, subset) + 1 + version = self._get_last_version(asset_name, subset_name) + 1 - instance = context.create_instance(subset) + instance = context.create_instance(subset_name) instance.data["asset"] = asset_name - instance.data["subset"] = subset + instance.data["subset"] = subset_name instance.data["family"] = family instance.data["families"] = families instance.data["version"] = version @@ -149,7 +157,7 @@ class CollectPublishedFiles(pyblish.api.ContextPlugin): extension (str): without '.' Returns: - (family, [families], subset_template_name, tags) tuple + (family, [families], tags) tuple AssertionError if not matching family found """ task_type = task_type.lower() @@ -184,7 +192,6 @@ class CollectPublishedFiles(pyblish.api.ContextPlugin): return (found_family, config["families"], - config["subset_template_name"], config["tags"]) def _get_last_version(self, asset_name, subset_name): diff --git a/openpype/settings/defaults/project_settings/webpublisher.json b/openpype/settings/defaults/project_settings/webpublisher.json index 2ab135e59b..77168c25e6 100644 --- a/openpype/settings/defaults/project_settings/webpublisher.json +++ b/openpype/settings/defaults/project_settings/webpublisher.json @@ -10,8 +10,7 @@ ], "families": [], "tags": [], - "result_family": "workfile", - "subset_template_name": "{family}{Variant}" + "result_family": "workfile" }, { "is_sequence": true, @@ -27,8 +26,7 @@ "tags": [ "review" ], - "result_family": "render", - "subset_template_name": "{family}{Variant}" + "result_family": "render" } ], "Compositing": [ @@ -39,8 +37,7 @@ ], "families": [], "tags": [], - "result_family": "workfile", - "subset_template_name": "{family}{Variant}" + "result_family": "workfile" }, { "is_sequence": true, @@ -56,8 +53,7 @@ "tags": [ "review" ], - "result_family": "render", - "subset_template_name": "{family}{Variant}" + "result_family": "render" } ], "Layout": [ @@ -68,8 +64,7 @@ ], "families": [], "tags": [], - "result_family": "workfile", - "subset_template_name": "{family}{Variant}" + "result_family": "workfile" }, { "is_sequence": false, @@ -86,8 +81,7 @@ "tags": [ "review" ], - "result_family": "image", - "subset_template_name": "{family}{Variant}" + "result_family": "image" } ], "default_task_type": [ @@ -99,8 +93,7 @@ ], "families": [], "tags": [], - "result_family": "workfile", - "subset_template_name": "{family}{Variant}" + "result_family": "workfile" }, { "is_sequence": true, @@ -116,8 +109,7 @@ "tags": [ "review" ], - "result_family": "render", - "subset_template_name": "{family}{Variant}" + "result_family": "render" } ], "__dynamic_keys_labels__": { diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_webpublisher.json b/openpype/settings/entities/schemas/projects_schema/schema_project_webpublisher.json index d15140db4d..b76a0fa844 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_webpublisher.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_webpublisher.json @@ -59,11 +59,6 @@ "type": "text", "key": "result_family", "label": "Resulting family" - }, - { - "type": "text", - "key": "subset_template_name", - "label": "Subset template name" } ] }