You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Getting the comments for a Widget through gazu can be done. However qtazu does not expose any widget that allows to choose a Task and display the available comments.
This would be an amazingly helpful Widget as it would allow for Artists to avoid having to go to Kitsu to read up on the notes on their current scene but instead can have it right next to them in the DCC or pipeline.
Here's a very simple example, but this should be much prettier:
importdatetimefromQtimportQtWidgets, QtCore, QtGuiimportgazufromqtazu.widgetsimporttaskbreadcrumbclassTaskComments(QtWidgets.QWidget):
def__init__(self, parent=None, task_id=None):
super(TaskComments, self).__init__(parent)
self._task=Nonebreadcrumb=taskbreadcrumb.TaskBreadcrumb()
comments=QtWidgets.QTextEdit()
comments.setReadOnly(True)
layout=QtWidgets.QVBoxLayout(self)
layout.addWidget(breadcrumb)
layout.addWidget(comments)
self.breadcrumb=breadcrumbself.comments=commentsself.setWindowTitle("CG-Wire Comments")
self.resize(250, 600)
iftask_id:
self.set_task(task_id)
defset_task(self, task_id):
# todo: Remove force to `str`task_id=str(task_id)
self._task=gazu.task.get_task(task_id)
self.comments.clear()
comments=gazu.task.all_comments_for_task(task_id)
text=""forcommentincomments:
ifnotcomment["text"]:
# Exclude empty comments for quick readability?# todo: do we want to do this by default? we could add a toggle to widgetcontinue# Include readable date in comment for parsingdate=datetime.datetime.strptime(comment["created_at"], '%Y-%m-%dT%H:%M:%S')
date=date.strftime('%Y-%m-%d %I:%M %p')
comment["date"] =date# Ensure new lines in comment text are parsedcomment["text"] =comment["text"].replace(r"\\n", "<br>")
html_start=""" <b>{person[first_name]} {person[last_name]}</b> | {date}<br> <br>""".format(**comment)
html_end=""" <br><br> ----<br> <br> """self.comments.insertHtml(html_start)
self.comments.insertPlainText(comment["text"])
self.comments.insertHtml(html_end)
Then to use it:
# Get a specific task by names (purely to aid in trying out the example)project=gazu.project.get_project_by_name("projectname")
sequence=gazu.shot.get_sequence_by_name(project, "sequencename")
shot=gazu.shot.get_shot_by_name(sequence, "shotname")
task=gazu.task.get_task_by_name(shot, gazu.task.get_task_type_by_name("taskname"))
# Use the example widgetwidget=TaskComments(task_id=task["id"])
widget.show()
In the end the goal is to have a similar view as Kitsu presents:
The text was updated successfully, but these errors were encountered:
Issue
Getting the comments for a Widget through
gazu
can be done. Howeverqtazu
does not expose any widget that allows to choose a Task and display the available comments.This would be an amazingly helpful Widget as it would allow for Artists to avoid having to go to Kitsu to read up on the notes on their current scene but instead can have it right next to them in the DCC or pipeline.
Here's a very simple example, but this should be much prettier:
Then to use it:
In the end the goal is to have a similar view as Kitsu presents:
The text was updated successfully, but these errors were encountered: