From 476921ce7ad3207e414a129c20de55fb22cd7006 Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Tue, 12 Dec 2023 13:55:41 +0100 Subject: [PATCH] move hierarchy key fill under 'newAssetPublishing' condition --- .../plugins/publish/collect_resources_path.py | 25 ++++++++----------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/openpype/plugins/publish/collect_resources_path.py b/openpype/plugins/publish/collect_resources_path.py index 9298ffe10c5..af0ef17789d 100644 --- a/openpype/plugins/publish/collect_resources_path.py +++ b/openpype/plugins/publish/collect_resources_path.py @@ -79,23 +79,18 @@ def process(self, instance): "representation": "TEMP" }) - # For the first time publish - if instance.data.get("hierarchy"): - template_data.update({ - "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 - } + if instance.data.get("newAssetPublishing"): + if "hierarchy" not in instance.data: + template_data["hierarchy"] = instance.data["hierarchy"] + + if "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: