mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
Refactor tag data handling for backward compatibility.
- Update product_name and product_type handling - Add error logging for missing values
This commit is contained in:
parent
cb4cf9d8c0
commit
f207c39649
2 changed files with 25 additions and 2 deletions
|
|
@ -630,7 +630,6 @@ class PublishClip:
|
|||
self.track_name = str(track_name).replace(" ", "_")
|
||||
self.track_index = int(timeline_item_data["track"]["index"])
|
||||
|
||||
# adding tag.family into tag
|
||||
if kwargs.get("avalon"):
|
||||
self.tag_data.update(kwargs["avalon"])
|
||||
|
||||
|
|
|
|||
|
|
@ -64,7 +64,28 @@ class PrecollectInstances(pyblish.api.ContextPlugin):
|
|||
})
|
||||
|
||||
asset = tag_data["folder_path"]
|
||||
product_name = tag_data["productName"]
|
||||
|
||||
# TODO: remove backward compatibility
|
||||
product_name = tag_data.get("productName")
|
||||
if product_name is None:
|
||||
# backward compatibility: subset -> productName
|
||||
product_name = tag_data.get("subset")
|
||||
|
||||
# backward compatibility: product_name should not be missing
|
||||
if not product_name:
|
||||
self.log.error(
|
||||
"Product name is not defined for: {}".format(asset))
|
||||
|
||||
# TODO: remove backward compatibility
|
||||
product_type = tag_data.get("productType")
|
||||
if product_type is None:
|
||||
# backward compatibility: family -> productType
|
||||
product_type = tag_data.get("family")
|
||||
|
||||
# backward compatibility: product_type should not be missing
|
||||
if not product_type:
|
||||
self.log.error(
|
||||
"Product type is not defined for: {}".format(asset))
|
||||
|
||||
data.update({
|
||||
"name": "{}_{}".format(asset, product_name),
|
||||
|
|
@ -77,6 +98,9 @@ class PrecollectInstances(pyblish.api.ContextPlugin):
|
|||
"handleEnd": handle_end,
|
||||
"newAssetPublishing": True,
|
||||
"families": ["clip"],
|
||||
"productType": product_type,
|
||||
"productName": product_name,
|
||||
"family": product_type
|
||||
})
|
||||
|
||||
# otio clip data
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue