Merge pull request #508 from tokejepsen/2.x/bugfix/nukestudio_comment

NukeStudio: Fix comment tag collection and integration.
This commit is contained in:
Jakub Ježek 2020-09-15 18:51:59 +02:00 committed by GitHub
commit c18d3a89e7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 26 additions and 5 deletions

View file

@ -167,6 +167,27 @@ class IntegrateHierarchyToFtrack(pyblish.api.ContextPlugin):
self.session.rollback()
six.reraise(tp, value, tb)
# Create notes.
user = self.session.query(
"User where username is \"{}\"".format(self.session.api_user)
).first()
if user:
for comment in entity_data.get("comments", []):
entity.create_note(comment, user)
else:
self.log.warning(
"Was not able to query current User {}".format(
self.session.api_user
)
)
try:
self.session.commit()
except Exception:
tp, value, tb = sys.exc_info()
self.session.rollback()
six.reraise(tp, value, tb)
# Import children.
if 'childs' in entity_data:
self.import_to_ftrack(
entity_data['childs'], entity)

View file

@ -273,8 +273,6 @@ class CollectHierarchyContext(pyblish.api.ContextPlugin):
instance.data["clipOut"] -
instance.data["clipIn"])
self.log.debug(
"__ instance.data[parents]: {}".format(
instance.data["parents"]
@ -319,6 +317,7 @@ class CollectHierarchyContext(pyblish.api.ContextPlugin):
})
in_info['tasks'] = instance.data['tasks']
in_info["comments"] = instance.data.get("comments", [])
parents = instance.data.get('parents', [])
self.log.debug("__ in_info: {}".format(in_info))

View file

@ -40,11 +40,12 @@ class CollectShots(api.InstancePlugin):
data["name"] = data["subset"] + "_" + data["asset"]
data["label"] = (
"{} - {} - tasks:{} - assetbuilds:{}".format(
"{} - {} - tasks: {} - assetbuilds: {} - comments: {}".format(
data["asset"],
data["subset"],
data["tasks"],
[x["name"] for x in data.get("assetbuilds", [])]
[x["name"] for x in data.get("assetbuilds", [])],
len(data.get("comments", []))
)
)

View file

@ -17,7 +17,7 @@ class CollectClipTagComments(api.InstancePlugin):
for tag in instance.data["tags"]:
if tag["name"].lower() == "comment":
instance.data["comments"].append(
tag.metadata().dict()["tag.note"]
tag["metadata"]["tag.note"]
)
# Find tags on the source clip.