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: