Skip to content

Commit

Permalink
Updated to support new Deadline Plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
gillesvink committed Sep 6, 2022
1 parent ac2ce12 commit 049d1e0
Show file tree
Hide file tree
Showing 10 changed files with 64 additions and 56 deletions.
Empty file modified .gitignore
100644 → 100755
Empty file.
Empty file modified .pre-commit-config.yaml
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion LICENSE
100644 → 100755
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Empty file modified README.md
100644 → 100755
Empty file.
40 changes: 22 additions & 18 deletions app.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -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
Empty file modified icon_256.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified info.yml
100644 → 100755
Empty file.
Empty file modified python/__init__.py
100644 → 100755
Empty file.
Empty file modified python/tk_multi_deadlinereviewsubmission/__init__.py
100644 → 100755
Empty file.
78 changes: 41 additions & 37 deletions python/tk_multi_deadlinereviewsubmission/handler.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def submit_to_deadline(
self,
template,
fields,
sg_publishes,
publish,
first_frame,
last_frame,
fps,
Expand All @@ -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,
Expand Down

0 comments on commit 049d1e0

Please sign in to comment.