mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 05:14:40 +01:00
Merged in feature/PYPE-682-nks-publish-audio-from (pull request #485)
NKS audio publshing worflow fixes Approved-by: Milan Kolar <milan@orbi.tools>
This commit is contained in:
commit
f5099693a6
7 changed files with 30 additions and 28 deletions
|
|
@ -18,7 +18,7 @@ Provides:
|
|||
import os
|
||||
import json
|
||||
|
||||
from avalon import io, api, lib
|
||||
from avalon import api, lib
|
||||
from pypeapp import Anatomy
|
||||
import pyblish.api
|
||||
|
||||
|
|
|
|||
|
|
@ -33,7 +33,6 @@ class CollectInstanceAnatomyData(pyblish.api.InstancePlugin):
|
|||
|
||||
order = pyblish.api.CollectorOrder + 0.49
|
||||
label = "Collect instance anatomy data"
|
||||
hosts = ["maya", "nuke", "standalonepublisher"]
|
||||
|
||||
def process(self, instance):
|
||||
# get all the stuff from the database
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
from pyblish import api
|
||||
|
||||
import os
|
||||
|
||||
class CollectAudio(api.InstancePlugin):
|
||||
"""Collect audio from tags.
|
||||
|
|
@ -12,7 +12,7 @@ class CollectAudio(api.InstancePlugin):
|
|||
"""
|
||||
|
||||
# Run just before CollectSubsets
|
||||
order = api.CollectorOrder + 0.1025
|
||||
order = api.CollectorOrder + 0.1021
|
||||
label = "Collect Audio"
|
||||
hosts = ["nukestudio"]
|
||||
families = ["clip"]
|
||||
|
|
@ -21,8 +21,10 @@ class CollectAudio(api.InstancePlugin):
|
|||
# Exclude non-tagged instances.
|
||||
tagged = False
|
||||
for tag in instance.data["tags"]:
|
||||
family = dict(tag["metadata"]).get("tag.family", "")
|
||||
tag_data = dict(tag["metadata"])
|
||||
family = tag_data.get("tag.family", "")
|
||||
if family.lower() == "audio":
|
||||
subset = tag_data.get("tag.subset", "Main")
|
||||
tagged = True
|
||||
|
||||
if not tagged:
|
||||
|
|
@ -40,14 +42,14 @@ class CollectAudio(api.InstancePlugin):
|
|||
data["family"] = "audio"
|
||||
data["families"] = ["ftrack"]
|
||||
|
||||
subset = ""
|
||||
for tag in instance.data["tags"]:
|
||||
tag_data = dict(tag["metadata"])
|
||||
if "tag.subset" in tag_data:
|
||||
subset = tag_data["tag.subset"]
|
||||
data["subset"] = "audio" + subset.title()
|
||||
|
||||
data["source"] = data["sourcePath"]
|
||||
|
||||
data["label"] = "{} - {} - ({})".format(
|
||||
data['asset'], data["subset"], os.path.splitext(data["sourcePath"])[
|
||||
1]
|
||||
)
|
||||
|
||||
self.log.debug("Creating instance with data: {}".format(data))
|
||||
instance.context.create_instance(**data)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import os
|
||||
|
||||
from pyblish import api
|
||||
|
||||
import hiero
|
||||
import nuke
|
||||
|
||||
class CollectClips(api.ContextPlugin):
|
||||
|
|
@ -48,7 +48,9 @@ class CollectClips(api.ContextPlugin):
|
|||
track = item.parent()
|
||||
source = item.source().mediaSource()
|
||||
source_path = source.firstpath()
|
||||
effects = [f for f in item.linkedItems() if f.isEnabled()]
|
||||
effects = [f for f in item.linkedItems()
|
||||
if f.isEnabled()
|
||||
if isinstance(f, hiero.core.EffectTrackItem)]
|
||||
|
||||
# If source is *.nk its a comp effect and we need to fetch the
|
||||
# write node output. This should be improved by parsing the script
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ class CollectPlates(api.InstancePlugin):
|
|||
"""
|
||||
|
||||
# Run just before CollectSubsets
|
||||
order = api.CollectorOrder + 0.1025
|
||||
order = api.CollectorOrder + 0.1021
|
||||
label = "Collect Plates"
|
||||
hosts = ["nukestudio"]
|
||||
families = ["clip"]
|
||||
|
|
@ -23,8 +23,10 @@ class CollectPlates(api.InstancePlugin):
|
|||
# Exclude non-tagged instances.
|
||||
tagged = False
|
||||
for tag in instance.data["tags"]:
|
||||
family = dict(tag["metadata"]).get("tag.family", "")
|
||||
tag_data = dict(tag["metadata"])
|
||||
family = tag_data.get("tag.family", "")
|
||||
if family.lower() == "plate":
|
||||
subset = tag_data.get("tag.subset", "Main")
|
||||
tagged = True
|
||||
break
|
||||
|
||||
|
|
@ -34,29 +36,27 @@ class CollectPlates(api.InstancePlugin):
|
|||
"\"plate\"".format(instance)
|
||||
)
|
||||
return
|
||||
self.log.debug("__ subset: `{}`".format(instance.data["subset"]))
|
||||
# if "audio" in instance.data["subset"]:
|
||||
# return
|
||||
|
||||
# Collect data.
|
||||
data = {}
|
||||
for key, value in instance.data.iteritems():
|
||||
data[key] = value
|
||||
|
||||
self.log.debug("__ family: `{}`".format(family))
|
||||
self.log.debug("__ subset: `{}`".format(subset))
|
||||
|
||||
data["family"] = family.lower()
|
||||
data["families"] = ["ftrack"] + instance.data["families"][1:]
|
||||
data["source"] = data["sourcePath"]
|
||||
|
||||
subset = ""
|
||||
for tag in instance.data["tags"]:
|
||||
tag_data = dict(tag["metadata"])
|
||||
if "tag.subset" in tag_data:
|
||||
subset = tag_data["tag.subset"]
|
||||
data["subset"] = data["family"] + subset.title()
|
||||
|
||||
data["subset"] = family + subset.title()
|
||||
data["name"] = data["subset"] + "_" + data["asset"]
|
||||
|
||||
data["label"] = "{} - {} - ({})".format(
|
||||
data['asset'], data["subset"], os.path.splitext(data["sourcePath"])[
|
||||
1]
|
||||
)
|
||||
data['asset'], data["subset"], os.path.splitext(
|
||||
data["sourcePath"])[1])
|
||||
|
||||
if "review" in instance.data["families"]:
|
||||
data["label"] += " - review"
|
||||
|
|
@ -146,6 +146,7 @@ class CollectPlatesData(api.InstancePlugin):
|
|||
head, padding = os.path.splitext(basename)
|
||||
ext = ext[1:]
|
||||
padding = padding[1:]
|
||||
self.log.debug("_ padding: `{}`".format(padding))
|
||||
# head, padding, ext = source_file.split('.')
|
||||
source_first_frame = int(padding)
|
||||
padding = len(padding)
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ class CollectReviews(api.InstancePlugin):
|
|||
order = api.CollectorOrder + 0.1022
|
||||
label = "Collect Reviews"
|
||||
hosts = ["nukestudio"]
|
||||
families = ["clip"]
|
||||
families = ["plate"]
|
||||
|
||||
def process(self, instance):
|
||||
# Exclude non-tagged instances.
|
||||
|
|
|
|||
|
|
@ -10,8 +10,6 @@ class ExtractAudioFile(pype.api.Extractor):
|
|||
hosts = ["nukestudio"]
|
||||
families = ["clip", "audio"]
|
||||
match = api.Intersection
|
||||
optional = True
|
||||
active = False
|
||||
|
||||
def process(self, instance):
|
||||
import os
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue