diff --git a/src/deadline/nuke_submitter/assets.py b/src/deadline/nuke_submitter/assets.py index 7f1aa03..f6536cd 100644 --- a/src/deadline/nuke_submitter/assets.py +++ b/src/deadline/nuke_submitter/assets.py @@ -22,7 +22,10 @@ def get_nuke_script_file() -> str: """Gets the nuke script file (.nk)""" - return normpath(nuke.root().knob("name").value()) + script_path = nuke.root().knob("name").value() + if script_path: + return normpath(script_path) + return "" def get_project_path() -> str: diff --git a/src/deadline/nuke_submitter/deadline_submitter_for_nuke.py b/src/deadline/nuke_submitter/deadline_submitter_for_nuke.py index b9dfe1a..8631360 100644 --- a/src/deadline/nuke_submitter/deadline_submitter_for_nuke.py +++ b/src/deadline/nuke_submitter/deadline_submitter_for_nuke.py @@ -184,8 +184,14 @@ def show_nuke_render_submitter(parent, f=Qt.WindowFlags()) -> "SubmitJobToDeadli render_settings.frame_list = str(nuke.root().frameRange()) render_settings.is_proxy_mode = nuke.root().proxy() + script_path = get_nuke_script_file() + if not script_path: + raise DeadlineOperationError( + "The Nuke Script is not saved to disk. Please save it before opening the submitter dialog." + ) + # Load the sticky settings - render_settings.load_sticky_settings(get_nuke_script_file()) + render_settings.load_sticky_settings(script_path) def on_create_job_bundle_callback( widget: SubmitJobToDeadlineDialog,