diff --git a/openpype/plugins/publish/collect_resources_path.py b/openpype/plugins/publish/collect_resources_path.py index 0f29fec054..9298ffe10c 100644 --- a/openpype/plugins/publish/collect_resources_path.py +++ b/openpype/plugins/publish/collect_resources_path.py @@ -68,7 +68,6 @@ class CollectResourcesPath(pyblish.api.InstancePlugin): ] def process(self, instance): - anatomy = instance.context.data["anatomy"] template_data = copy.deepcopy(instance.data["anatomyData"]) @@ -86,6 +85,18 @@ class CollectResourcesPath(pyblish.api.InstancePlugin): "hierarchy": instance.data["hierarchy"] }) + # Add fill keys for editorial publishing creating new entity + # TODO handle in editorial plugin + if ( + instance.data.get("newAssetPublishing") + and "asset" not in template_data + ): + asset_name = instance.data["asset"].split("/")[-1] + template_data["asset"] = asset_name + template_data["folder"] = { + "name": asset_name + } + publish_templates = anatomy.templates_obj["publish"] if "folder" in publish_templates: publish_folder = publish_templates["folder"].format_strict(