forked from aws-deadline/deadline-cloud-for-nuke
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Resolve menu.py not found error when running `pip install deadli…
…ne-cloud-for-nuke -t <folder>`
- Loading branch information
1 parent
08b2b27
commit 6ea0eb7
Showing
8 changed files
with
109 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
job_bundle_output_tests/cwd-path/scene/cwd-path.deadline_render_settings.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"name": "cwd-path.nk", | ||
"description": "", | ||
"override_frame_range": false, | ||
"frame_list": "1-100", | ||
"write_node_selection": null, | ||
"view_selection": "", | ||
"is_proxy_mode": false, | ||
"input_filenames": [], | ||
"input_directories": [], | ||
"output_directories": [], | ||
"timeouts_enabled": true, | ||
"on_run_timeout_seconds": 518400, | ||
"on_enter_timeout_seconds": 86400, | ||
"on_exit_timeout_seconds": 3600, | ||
"include_adaptor_wheels": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
|
||
""" | ||
DO NOT CHANGE THIS FILE's NAME | ||
Nuke loads this "init.py" or "menu.py" when looking in its plugin folder. | ||
You can inform nuke to look in additional locations by setting via the | ||
NUKE_PATH environment variable. | ||
""" | ||
|
||
import nuke | ||
import os | ||
|
||
from deadline.nuke_submitter import ( | ||
show_nuke_render_submitter_noargs, | ||
run_render_submitter_job_bundle_output_test, | ||
) | ||
|
||
|
||
def add_deadline_menu() -> None: | ||
try: | ||
menu_bar = nuke.menu("Nuke") | ||
aws_deadline_menu = menu_bar.addMenu("&AWS Deadline") | ||
aws_deadline_menu.addCommand( | ||
"Submit to Deadline Cloud", show_nuke_render_submitter_noargs, "" | ||
) | ||
# Set the environment variable DEADLINE_ENABLE_DEVELOPER_OPTIONS to "true" to get this menu. | ||
if os.environ.get("DEADLINE_ENABLE_DEVELOPER_OPTIONS", "").upper() == "TRUE": | ||
aws_deadline_menu.addCommand( | ||
"Run Nuke Submitter Job Bundle Output Tests...", | ||
run_render_submitter_job_bundle_output_test, | ||
"", | ||
) | ||
except BaseException: | ||
import sys | ||
import traceback | ||
|
||
print("Failed to load deadline.nuke_submitter. Reason:", file=sys.stderr) | ||
print(traceback.format_exc(), file=sys.stderr) | ||
|
||
|
||
add_deadline_menu() |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import os | ||
import nuke | ||
from unittest.mock import ANY | ||
from deadline.nuke_submitter.menu import add_deadline_menu | ||
|
||
|
||
def test_add_deadline_menu_env_var_true() -> None: | ||
# GIVEN | ||
os.environ["DEADLINE_ENABLE_DEVELOPER_OPTIONS"] = "true" | ||
|
||
# WHEN | ||
add_deadline_menu() | ||
|
||
# THEN | ||
nuke.menu("Nuke").addMenu.assert_called_with("&AWS Deadline") | ||
assert nuke.menu("Nuke").addMenu("&AWS Deadline").addCommand.call_count == 3 | ||
nuke.menu("Nuke").addMenu("&AWS Deadline").addCommand.assert_called_with( | ||
"Run Nuke Submitter Job Bundle Output Tests...", ANY, ANY | ||
) | ||
|
||
|
||
def test_add_deadline_menu_env_var_false() -> None: | ||
# GIVEN | ||
os.environ["DEADLINE_ENABLE_DEVELOPER_OPTIONS"] = "false" | ||
|
||
# WHEN | ||
add_deadline_menu() | ||
|
||
# THEN | ||
nuke.menu("Nuke").addMenu.assert_called_with("&AWS Deadline") | ||
assert nuke.menu("Nuke").addMenu("&AWS Deadline").addCommand.call_count == 2 | ||
nuke.menu("Nuke").addMenu("&AWS Deadline").addCommand.assert_called_with( | ||
"Submit to Deadline Cloud", ANY, ANY | ||
) |