mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-26 22:02:15 +01:00
feat(nukestudil): collecting Clip Types from Tags
This commit is contained in:
parent
c9e13f16c7
commit
fe23ed0d7c
1 changed files with 34 additions and 0 deletions
34
pype/plugins/nukestudio/publish/collect_tag_types.py
Normal file
34
pype/plugins/nukestudio/publish/collect_tag_types.py
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
from pyblish import api
|
||||
|
||||
|
||||
class CollectClipTagTypes(api.InstancePlugin):
|
||||
"""Collect Types from Tags of selected track items."""
|
||||
|
||||
order = api.CollectorOrder + 0.007
|
||||
label = "Collect Plate Type from Tag"
|
||||
hosts = ["nukestudio"]
|
||||
families = ['clip']
|
||||
|
||||
def process(self, instance):
|
||||
# gets tags
|
||||
tags = instance.data["tags"]
|
||||
|
||||
subset_names = list()
|
||||
for t in tags:
|
||||
t_metadata = dict(t["metadata"])
|
||||
t_family = t_metadata.get("tag.family", "")
|
||||
|
||||
# gets only task family tags and collect labels
|
||||
if "plate" in t_family:
|
||||
t_type = t_metadata.get("tag.type", "")
|
||||
t_order = t_metadata.get("tag.order", "")
|
||||
subset_type = "{0}{1}".format(
|
||||
t_type.capitalize(), t_order)
|
||||
subset_names.append(subset_type)
|
||||
|
||||
if subset_names:
|
||||
instance.data["subsetType"] = subset_names[0]
|
||||
|
||||
self.log.info("Collected Plate Types from Tags: `{}`".format(
|
||||
instance.data["subsetType"]))
|
||||
return
|
||||
Loading…
Add table
Add a link
Reference in a new issue