move hierarchy key fill under 'newAssetPublishing' condition

This commit is contained in:
Jakub Trllo 2023-12-12 13:55:41 +01:00
parent 232c0b58fe
commit 476921ce7a

View file

@ -79,23 +79,18 @@ class CollectResourcesPath(pyblish.api.InstancePlugin):
"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: