Skip to content

Commit

Permalink
FP-79 Added company logo to configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
MaximumFX committed Sep 24, 2024
1 parent 61d8521 commit 5c34d68
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 1,075 deletions.
10 changes: 10 additions & 0 deletions info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,16 @@ configuration:
description: ShotGrid script key

# --- PATHS ---
logo_path_linux:
type: str
description: Linux path to the company logo.
logo_path_mac:
type: str
description: Mac path to the company logo.
logo_path_windows:
type: str
description: Windows path to the company logo.

font_path_linux:
type: str
description: Linux path to the regular font to use.
Expand Down
4 changes: 4 additions & 0 deletions python/app/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,18 +81,21 @@ def __init__(self, app, logger) -> None:

if sgtk.util.is_linux():
self.nuke_path = "{}".format(app.get_setting("nuke_path_linux"))
self.logo_path = "{}".format(app.get_setting("logo_path_linux"))
self.font_path = "{}".format(app.get_setting("font_path_linux"))
self.font_bold_path = "{}".format(
app.get_setting("font_bold_path_linux")
)
elif sgtk.util.is_macos():
self.nuke_path = "{}".format(app.get_setting("nuke_path_mac"))
self.logo_path = "{}".format(app.get_setting("logo_path_mac"))
self.font_path = "{}".format(app.get_setting("font_path_mac"))
self.font_bold_path = "{}".format(
app.get_setting("font_bold_path_mac")
)
elif sgtk.util.is_windows():
self.nuke_path = "{}".format(app.get_setting("nuke_path_windows"))
self.logo_path = "{}".format(app.get_setting("logo_path_windows"))
self.font_path = "{}".format(app.get_setting("font_path_windows"))
self.font_bold_path = "{}".format(
app.get_setting("font_bold_path_windows")
Expand Down Expand Up @@ -689,6 +692,7 @@ def deliver_version(
self.settings.sg_server_path,
self.settings.sg_script_name,
self.settings.sg_script_key,
self.logo_path,
"--version-id",
version.id_str,
"-idt",
Expand Down
17 changes: 17 additions & 0 deletions python/app/slate.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ class ShotGridSlate(object):
shotgrid_site (str): url for ShotGrid site
script_name (str): API name for script on ShotGrid
script_key (str): API key for script on ShotGrid
logo_path (str): Path to company logo
fps (float, optional): fps used by project. Defaults to 25.0.
company (str, optional): company name to add to slate. Defaults to "ShotGrid".
colorspace_idt (str, optional): Input colorspace. Defaults to "ACES - ACEScg".
Expand All @@ -68,6 +69,7 @@ def __init__(
shotgrid_site,
script_name,
script_key,
logo_path: str,
fps=25.0,
company="ShotGrid",
colorspace_idt="ACES - ACEScg",
Expand All @@ -84,6 +86,7 @@ def __init__(
self.shotgrid_site = shotgrid_site
self.script_name = script_name
self.script_key = script_key
self.logo_path = logo_path
self.fps = fps
self.company = company
self.colorspace_idt = colorspace_idt
Expand Down Expand Up @@ -403,6 +406,20 @@ def __setup_slate(

slate = nuke.toNode("NETFLIX_TEMPLATE_SLATE")

if self.logo_path.endswith(".nk"):
logo = nuke.nodePaste(self.logo_path)

for node in nuke.selectedNodes():
node["selected"].setValue(False)

slate.setInput(1, logo)
else:
logo = nuke.nodes.Read(file=self.logo_path)
premult = nuke.nodes.Premult()
premult.setInput(0, logo)

slate.setInput(1, premult)

sg_project = self.__get_project_data()
sg_version = self.__get_version_data()
sg_shot = self.__get_shot_data(sg_version)
Expand Down
1 change: 1 addition & 0 deletions python/app/slate_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
parser.add_argument("shotgrid_site", type=str)
parser.add_argument("script_name", type=str)
parser.add_argument("script_key", type=str)
parser.add_argument("logo_path", type=str)

parser.add_argument(
"-c", "--company", default="ShotGrid", type=str, metavar="name"
Expand Down
Loading

0 comments on commit 5c34d68

Please sign in to comment.