mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
Merged in tokejepsen/pype/feature/nukestudio_comments (pull request #279)
Publish comments from NukeStudio.
This commit is contained in:
commit
13c46a8cd8
3 changed files with 66 additions and 2 deletions
24
pype/plugins/ftrack/publish/integrate_ftrack_comments.py
Normal file
24
pype/plugins/ftrack/publish/integrate_ftrack_comments.py
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
import pyblish.api
|
||||
|
||||
|
||||
class IntegrateFtrackComments(pyblish.api.InstancePlugin):
|
||||
"""Create comments in Ftrack."""
|
||||
|
||||
order = pyblish.api.IntegratorOrder
|
||||
label = "Integrate Comments to Ftrack."
|
||||
families = ["shot"]
|
||||
|
||||
def process(self, instance):
|
||||
session = instance.context.data["ftrackSession"]
|
||||
|
||||
entity = session.query(
|
||||
"Shot where name is \"{}\"".format(instance.data["item"].name())
|
||||
).one()
|
||||
|
||||
notes = []
|
||||
for comment in instance.data["comments"]:
|
||||
notes.append(session.create("Note", {"content": comment}))
|
||||
|
||||
entity["notes"].extend(notes)
|
||||
|
||||
session.commit()
|
||||
|
|
@ -39,8 +39,13 @@ class CollectShots(api.InstancePlugin):
|
|||
|
||||
data["name"] = data["subset"] + "_" + data["asset"]
|
||||
|
||||
data["label"] = data["asset"] + " - " + data["subset"] + " - tasks: {} - assetbuilds: {}".format(
|
||||
data["tasks"], [x["name"] for x in data.get("assetbuilds", [])]
|
||||
data["label"] = (
|
||||
"{} - {} - tasks:{} - assetbuilds:{}".format(
|
||||
data["asset"],
|
||||
data["subset"],
|
||||
data["tasks"],
|
||||
[x["name"] for x in data.get("assetbuilds", [])]
|
||||
)
|
||||
)
|
||||
|
||||
# Create instance.
|
||||
|
|
|
|||
35
pype/plugins/nukestudio/publish/collect_tag_comments.py
Normal file
35
pype/plugins/nukestudio/publish/collect_tag_comments.py
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
from pyblish import api
|
||||
|
||||
|
||||
class CollectClipTagComments(api.InstancePlugin):
|
||||
"""Collect comments from tags on selected track items and their sources."""
|
||||
|
||||
order = api.CollectorOrder + 0.013
|
||||
label = "Collect Comments"
|
||||
hosts = ["nukestudio"]
|
||||
families = ["clip"]
|
||||
|
||||
def process(self, instance):
|
||||
# Collect comments.
|
||||
instance.data["comments"] = []
|
||||
|
||||
# Exclude non-tagged instances.
|
||||
for tag in instance.data["tags"]:
|
||||
if tag["name"].lower() == "comment":
|
||||
instance.data["comments"].append(
|
||||
tag.metadata().dict()["tag.note"]
|
||||
)
|
||||
|
||||
# Find tags on the source clip.
|
||||
tags = instance.data["item"].source().tags()
|
||||
for tag in tags:
|
||||
if tag.name().lower() == "comment":
|
||||
instance.data["comments"].append(
|
||||
tag.metadata().dict()["tag.note"]
|
||||
)
|
||||
|
||||
# Update label with comments counter.
|
||||
instance.data["label"] = "{} - comments:{}".format(
|
||||
instance.data["label"],
|
||||
len(instance.data["comments"])
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue