From 049d1e0c1135540c4636a05b9421e7ee6c4d78be Mon Sep 17 00:00:00 2001 From: Gilles Vink Date: Tue, 6 Sep 2022 15:50:02 +0200 Subject: [PATCH] Updated to support new Deadline Plugin --- .gitignore | 0 .pre-commit-config.yaml | 0 LICENSE | 2 +- README.md | 0 app.py | 40 +++++---- icon_256.png | Bin info.yml | 0 python/__init__.py | 0 .../__init__.py | 0 .../handler.py | 78 +++++++++--------- 10 files changed, 64 insertions(+), 56 deletions(-) mode change 100644 => 100755 .gitignore mode change 100644 => 100755 .pre-commit-config.yaml mode change 100644 => 100755 LICENSE mode change 100644 => 100755 README.md mode change 100644 => 100755 app.py mode change 100644 => 100755 icon_256.png mode change 100644 => 100755 info.yml mode change 100644 => 100755 python/__init__.py mode change 100644 => 100755 python/tk_multi_deadlinereviewsubmission/__init__.py mode change 100644 => 100755 python/tk_multi_deadlinereviewsubmission/handler.py diff --git a/.gitignore b/.gitignore old mode 100644 new mode 100755 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml old mode 100644 new mode 100755 diff --git a/LICENSE b/LICENSE old mode 100644 new mode 100755 index 6a76b2a..281e45c --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2020 Netherlands Film Academy +Copyright (c) 2022 Netherlands Film Academy Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md old mode 100644 new mode 100755 diff --git a/app.py b/app.py old mode 100644 new mode 100755 index 38458a2..957c4fe --- a/app.py +++ b/app.py @@ -34,30 +34,34 @@ def init_app(self): """ Called as the application is being initialized """ - self.tk_multi_deadlinereviewsubmission = self.import_module("tk_multi_deadlinereviewsubmission") - self.handler = self.tk_multi_deadlinereviewsubmission.DeadlineReviewSubmissionHandler() + self.tk_multi_deadlinereviewsubmission = self.import_module( + "tk_multi_deadlinereviewsubmission" + ) + self.handler = ( + self.tk_multi_deadlinereviewsubmission.DeadlineReviewSubmissionHandler() + ) def submit_version( self, - template=None, - fields=None, - sg_publishes=None, - start_frame=None, - end_frame=None, - fps=None, - filename=None, - comment=None + template, + fields, + publish, + first_frame, + last_frame, + fps, + colorspace_idt=None, + colorspace_odt=None, ): result = self.handler.submit_to_deadline( - template, - fields, - sg_publishes, - start_frame, - end_frame, - fps, - filename, - comment + template=template, + fields=fields, + publish=publish, + first_frame=first_frame, + last_frame=last_frame, + fps=fps, + colorspace_idt=colorspace_idt, + colorspace_odt=colorspace_odt, ) return result diff --git a/icon_256.png b/icon_256.png old mode 100644 new mode 100755 diff --git a/info.yml b/info.yml old mode 100644 new mode 100755 diff --git a/python/__init__.py b/python/__init__.py old mode 100644 new mode 100755 diff --git a/python/tk_multi_deadlinereviewsubmission/__init__.py b/python/tk_multi_deadlinereviewsubmission/__init__.py old mode 100644 new mode 100755 diff --git a/python/tk_multi_deadlinereviewsubmission/handler.py b/python/tk_multi_deadlinereviewsubmission/handler.py old mode 100644 new mode 100755 index 70d5a9b..ad7552e --- a/python/tk_multi_deadlinereviewsubmission/handler.py +++ b/python/tk_multi_deadlinereviewsubmission/handler.py @@ -39,7 +39,7 @@ def submit_to_deadline( self, template, fields, - sg_publishes, + publish, first_frame, last_frame, fps, @@ -64,42 +64,46 @@ def submit_to_deadline( fields["SEQ"] = "FORMAT: %d" sequence_path = template.apply_fields(fields) - for publish in sg_publishes: - - # Getting publish id - publish_id = publish.get("id") - - # Getting settings from the app configuration - priority = self.__app.get_setting("default_priority") - company = self.__app.get_setting("company_name") - - slate_path = self.__app.get_template("review_output_path") - slate_path = slate_path.apply_fields(fields) - - department = "ShotGrid" - plugin = "ShotGridReview" - - # Every argument has to be split because we are - # sending it via deadlinecommand - submission_parameters = self.__get_submission_parameters( - plugin=plugin, - priority=priority, - department=department, - publish_id=publish_id, - first_frame=first_frame, - last_frame=last_frame, - fps=fps, - sequence_path=sequence_path, - slate_path=slate_path, - company=company, - colorspace_idt=colorspace_idt, - colorspace_odt=colorspace_odt, - ) - - # Submit to Deadline - self.__submit_to_deadline(submission_parameters) - - return slate_path + # Getting publish id + publish_id = publish.get("id") + + # Getting settings from the app configuration + priority = self.__app.get_setting("default_priority") + company = self.__app.get_setting("company_name") + + slate_path = self.__app.get_template("review_output_path") + slate_path = slate_path.apply_fields(fields) + + if colorspace_idt is None: + colorspace_idt = self.__app.get_setting("default_colorspace_idt") + + if colorspace_odt is None: + colorspace_odt = self.__app.get_setting("default_colorspace_odt") + + department = "Pipeline" + plugin = "ShotGridReview" + + # Every argument has to be split because we are + # sending it via deadlinecommand + submission_parameters = self.__get_submission_parameters( + plugin=plugin, + priority=priority, + department=department, + publish_id=publish_id, + first_frame=first_frame, + last_frame=last_frame, + fps=fps, + sequence_path=sequence_path, + slate_path=slate_path, + company=company, + colorspace_idt=colorspace_idt, + colorspace_odt=colorspace_odt, + ) + + # Submit to Deadline + self.__submit_to_deadline(submission_parameters) + + return slate_path def __get_submission_parameters( self,