mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 05:14:40 +01:00
use folder naming in hiero precollect plugins
This commit is contained in:
parent
c131071c7d
commit
89c477dce7
2 changed files with 27 additions and 27 deletions
|
|
@ -90,7 +90,7 @@ class PrecollectInstances(pyblish.api.ContextPlugin):
|
|||
if "entity_type" in parent:
|
||||
parent["folder_type"] = parent.pop("entity_type")
|
||||
|
||||
asset, asset_name = self._get_folder_data(tag_data)
|
||||
folder_path, folder_name = self._get_folder_data(tag_data)
|
||||
|
||||
product_name = tag_data.get("productName")
|
||||
if product_name is None:
|
||||
|
|
@ -98,12 +98,6 @@ class PrecollectInstances(pyblish.api.ContextPlugin):
|
|||
|
||||
families = [str(f) for f in tag_data["families"]]
|
||||
|
||||
# form label
|
||||
label = "{} -".format(asset)
|
||||
if asset_name != clip_name:
|
||||
label += " ({})".format(clip_name)
|
||||
label += " {}".format(product_name)
|
||||
|
||||
# TODO: remove backward compatibility
|
||||
product_name = tag_data.get("productName")
|
||||
if product_name is None:
|
||||
|
|
@ -113,7 +107,7 @@ class PrecollectInstances(pyblish.api.ContextPlugin):
|
|||
# backward compatibility: product_name should not be missing
|
||||
if not product_name:
|
||||
self.log.error(
|
||||
"Product name is not defined for: {}".format(asset))
|
||||
"Product name is not defined for: {}".format(folder_path))
|
||||
|
||||
# TODO: remove backward compatibility
|
||||
product_type = tag_data.get("productType")
|
||||
|
|
@ -124,15 +118,21 @@ class PrecollectInstances(pyblish.api.ContextPlugin):
|
|||
# backward compatibility: product_type should not be missing
|
||||
if not product_type:
|
||||
self.log.error(
|
||||
"Product type is not defined for: {}".format(asset))
|
||||
"Product type is not defined for: {}".format(folder_path))
|
||||
|
||||
# form label
|
||||
label = "{} -".format(folder_path)
|
||||
if folder_name != clip_name:
|
||||
label += " ({})".format(clip_name)
|
||||
label += " {}".format(product_name)
|
||||
|
||||
data.update({
|
||||
"name": "{}_{}".format(asset, product_name),
|
||||
"name": "{}_{}".format(folder_path, product_name),
|
||||
"label": label,
|
||||
"folderPath": asset,
|
||||
"asset_name": asset_name,
|
||||
"productName": product_name,
|
||||
"productType": product_type,
|
||||
"folderPath": folder_path,
|
||||
"asset_name": folder_name,
|
||||
"item": track_item,
|
||||
"families": families,
|
||||
"publish": tag_data["publish"],
|
||||
|
|
@ -222,19 +222,19 @@ class PrecollectInstances(pyblish.api.ContextPlugin):
|
|||
if not hierarchy_data:
|
||||
return
|
||||
|
||||
asset = data["folderPath"]
|
||||
asset_name = data["asset_name"]
|
||||
folder_path = data["folderPath"]
|
||||
folder_name = data["asset_name"]
|
||||
|
||||
product_type = "shot"
|
||||
|
||||
# form label
|
||||
label = "{} -".format(asset)
|
||||
if asset_name != clip_name:
|
||||
label = "{} -".format(folder_path)
|
||||
if folder_name != clip_name:
|
||||
label += " ({}) ".format(clip_name)
|
||||
label += " {}".format(product_name)
|
||||
|
||||
data.update({
|
||||
"name": "{}_{}".format(asset, product_name),
|
||||
"name": "{}_{}".format(folder_path, product_name),
|
||||
"label": label,
|
||||
"productName": product_name,
|
||||
"productType": product_type,
|
||||
|
|
@ -281,19 +281,19 @@ class PrecollectInstances(pyblish.api.ContextPlugin):
|
|||
if not self.test_any_audio(item):
|
||||
return
|
||||
|
||||
asset = data["folderPath"]
|
||||
folder_path = data["folderPath"]
|
||||
asset_name = data["asset_name"]
|
||||
|
||||
product_type = "audio"
|
||||
|
||||
# form label
|
||||
label = "{} -".format(asset)
|
||||
label = "{} -".format(folder_path)
|
||||
if asset_name != clip_name:
|
||||
label += " ({}) ".format(clip_name)
|
||||
label += " {}".format(product_name)
|
||||
|
||||
data.update({
|
||||
"name": "{}_{}".format(asset, product_name),
|
||||
"name": "{}_{}".format(folder_path, subset),
|
||||
"label": label,
|
||||
"productName": product_name,
|
||||
"productType": product_type,
|
||||
|
|
|
|||
|
|
@ -17,8 +17,8 @@ class PrecollectWorkfile(pyblish.api.ContextPlugin):
|
|||
order = pyblish.api.CollectorOrder - 0.491
|
||||
|
||||
def process(self, context):
|
||||
asset = context.data["folderPath"]
|
||||
asset_name = asset.split("/")[-1]
|
||||
folder_path = context.data["folderPath"]
|
||||
folder_name = folder_path.split("/")[-1]
|
||||
|
||||
active_timeline = hiero.ui.activeSequence()
|
||||
project = active_timeline.project()
|
||||
|
|
@ -62,12 +62,12 @@ class PrecollectWorkfile(pyblish.api.ContextPlugin):
|
|||
product_type = "workfile"
|
||||
instance_data = {
|
||||
"label": "{} - {}Main".format(
|
||||
asset, product_type),
|
||||
"name": "{}_{}".format(asset_name, product_type),
|
||||
"folderPath": context.data["folderPath"],
|
||||
# TODO use 'get_product_name'
|
||||
folder_path, product_type),
|
||||
"name": "{}_{}".format(folder_name, product_type),
|
||||
"folderPath": folder_path,
|
||||
# TODO use 'get_subset_name'
|
||||
"productName": "{}{}Main".format(
|
||||
asset_name, product_type.capitalize()
|
||||
folder_name, product_type.capitalize()
|
||||
),
|
||||
"item": project,
|
||||
"productType": product_type,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue