From 244f70083e4e8b1f3d143b178f2964b49e9ee30a Mon Sep 17 00:00:00 2001 From: "robin@ynput.io" Date: Mon, 2 Mar 2026 18:40:35 +0100 Subject: [PATCH 01/10] Ensure Nuke host get installed in terminal mode. --- client/ayon_nuke/api/lib.py | 5 ++- client/ayon_nuke/api/pipeline.py | 36 ++++++++++--------- client/ayon_nuke/api/push_to_project.py | 5 ++- client/ayon_nuke/api/utils.py | 29 +++++++++------ .../api/workfile_template_builder.py | 18 ++++++++-- client/ayon_nuke/startup/init.py | 5 +++ client/ayon_nuke/startup/menu.py | 7 ++-- 7 files changed, 69 insertions(+), 36 deletions(-) create mode 100644 client/ayon_nuke/startup/init.py diff --git a/client/ayon_nuke/api/lib.py b/client/ayon_nuke/api/lib.py index 7d2ae147ea..ac0a0f3dad 100644 --- a/client/ayon_nuke/api/lib.py +++ b/client/ayon_nuke/api/lib.py @@ -14,7 +14,6 @@ import ayon_api from ayon_core.host import HostDirmap -from ayon_core.tools.utils import host_tools from ayon_core.pipeline.workfile.workfile_template_builder import ( TemplateProfileNotFound ) @@ -2498,6 +2497,9 @@ def launch_workfiles_app(): def _launch_workfile_app(): # Safeguard to not show window when application is still starting up # or is already closing down. + if not nuke.GUI: + raise RuntimeError("Invalid in non-GUI mode.") + closing_down = QtWidgets.QApplication.closingDown() starting_up = QtWidgets.QApplication.startingUp() @@ -2515,6 +2517,7 @@ def _launch_workfile_app(): # - this happened on Centos 7 and it is because the focus of nuke # changes to the main window after showing because of initialization # which moves workfiles tool under it + from ayon_core.tools.utils import host_tools host_tools.show_workfiles(parent=None, on_top=True) diff --git a/client/ayon_nuke/api/pipeline.py b/client/ayon_nuke/api/pipeline.py index 68c524dd04..b37fc28abf 100644 --- a/client/ayon_nuke/api/pipeline.py +++ b/client/ayon_nuke/api/pipeline.py @@ -26,9 +26,7 @@ registered_host, ) from ayon_core.pipeline.workfile import BuildWorkfile -from ayon_core.tools.utils import host_tools from ayon_nuke import NUKE_ROOT_DIR -from ayon_core.tools.workfile_template_build import open_template_ui # Function 'get_current_project_settings' was moved in ayon-core 1.5.1 try: @@ -136,17 +134,21 @@ def install(self): register_event_callback("workio.open_file", check_inventory_versions) register_event_callback("taskChanged", change_context_label) project_settings = get_current_project_settings() - if nuke.GUI: - _install_menu(project_settings) - - # add script menu - add_scripts_menu() - add_scripts_gizmo() add_nuke_callbacks(project_settings) launch_workfiles_app() + def setup_menu(self): + """Setup AYON menus.""" + if not nuke.GUI: + raise RuntimeError("Cannot set up menus in non-GUI mode.") + + project_settings = get_current_project_settings() + _install_menu(project_settings) + add_scripts_menu() + add_scripts_gizmo() + def get_context_data(self): root_node = nuke.root() return get_node_data(root_node, ROOT_DATA_KNOB) @@ -217,14 +219,6 @@ def reload_config(): reload(module) -def _show_workfiles(): - # Make sure parent is not set - # - this makes Workfiles tool as separated window which - # avoid issues with reopening - # - it is possible to explicitly change on top flag of the tool - host_tools.show_workfiles(parent=None, on_top=False) - - def get_context_label(): return "{0}, {1}".format( get_current_folder_path(), @@ -234,6 +228,9 @@ def get_context_label(): def _install_menu(project_settings: dict): """Install AYON menu into Nuke's main menu bar.""" + # local imports, modules not available in non-GUI mode + from ayon_core.tools.utils import host_tools + from ayon_core.tools.workfile_template_build import open_template_ui # uninstall original AYON menu main_window = get_main_window() @@ -267,6 +264,13 @@ def _install_menu(project_settings: dict): shortcut_str ) + def _show_workfiles(): + # Make sure parent is not set + # - this makes Workfiles tool as separated window which + # avoid issues with reopening + # - it is possible to explicitly change on top flag of the tool + host_tools.show_workfiles(parent=None, on_top=False) + menu.addCommand( "Work Files...", _show_workfiles diff --git a/client/ayon_nuke/api/push_to_project.py b/client/ayon_nuke/api/push_to_project.py index b907c8f24d..999d41885b 100644 --- a/client/ayon_nuke/api/push_to_project.py +++ b/client/ayon_nuke/api/push_to_project.py @@ -7,7 +7,6 @@ from ayon_core.pipeline import Anatomy, registered_host from ayon_core.pipeline.template_data import get_template_data from ayon_core.pipeline.workfile import get_workdir_with_workdir_data -from ayon_core.tools import context_dialog from .utils import bake_gizmos_recursively from .lib import MENU_LABEL @@ -46,6 +45,10 @@ def bake_container(container): def main(): + if not nuke.GUI: + raise RuntimeError("Invalid in none-GUI mode.") + + from ayon_core.tools import context_dialog context = context_dialog.ask_for_context() if context is None: diff --git a/client/ayon_nuke/api/utils.py b/client/ayon_nuke/api/utils.py index dc215378ae..91137b6e7f 100644 --- a/client/ayon_nuke/api/utils.py +++ b/client/ayon_nuke/api/utils.py @@ -8,7 +8,6 @@ from ayon_core import resources from ayon_core.pipeline import registered_host -from ayon_core.tools.utils import show_message_dialog from ayon_core.pipeline.create import CreateContext @@ -111,7 +110,7 @@ def submit_render_on_farm(node): _submit_render_on_farm(node) -def _submit_render_on_farm(node): +def _submit_render_on_farm(node) -> bool: """Render on farm submission This function prepares the context for farm submission, validates it, @@ -120,6 +119,9 @@ def _submit_render_on_farm(node): Args: node (Node): The node for which the farm submission is being made. + + Returns: + bool. Has the submission succeed? """ host = registered_host() @@ -163,12 +165,17 @@ def _submit_render_on_farm(node): error_message += "\n" error_message += err.formatted_traceback - if not success: - show_message_dialog( - "Publish Errors", error_message, level="critical" - ) - return - - show_message_dialog( - "Submission Successful", "Submission to the farm was successful." - ) + if nuke.GUI: + from ayon_core.tools.utils import show_message_dialog + if success: + show_message_dialog( + "Submission Successful", + "Submission to the farm was successful." + ) + else: + show_message_dialog( + "Publish Errors", + error_message, level="critical" + ) + + return success diff --git a/client/ayon_nuke/api/workfile_template_builder.py b/client/ayon_nuke/api/workfile_template_builder.py index aebf91c4a4..4b1e225e84 100644 --- a/client/ayon_nuke/api/workfile_template_builder.py +++ b/client/ayon_nuke/api/workfile_template_builder.py @@ -6,9 +6,7 @@ AbstractTemplateBuilder, PlaceholderPlugin, ) -from ayon_core.tools.workfile_template_build import ( - WorkfileBuildPlaceholderDialog, -) + from .lib import ( imprint, reset_selection, @@ -122,6 +120,13 @@ def update_workfile_template(*args): def create_placeholder(*args): + if not nuke.GUI: + raise RuntimeError("Invalid in non-GUI mode.") + + from ayon_core.tools.workfile_template_build import ( + WorkfileBuildPlaceholderDialog, + ) + host = registered_host() builder = NukeTemplateBuilder(host) window = WorkfileBuildPlaceholderDialog(host, builder, @@ -130,6 +135,13 @@ def create_placeholder(*args): def update_placeholder(*args): + if not nuke.GUI: + raise RuntimeError("Invalid in non-GUI mode.") + + from ayon_core.tools.workfile_template_build import ( + WorkfileBuildPlaceholderDialog, + ) + host = registered_host() builder = NukeTemplateBuilder(host) placeholder_items_by_id = { diff --git a/client/ayon_nuke/startup/init.py b/client/ayon_nuke/startup/init.py new file mode 100644 index 0000000000..c3dd8cda8f --- /dev/null +++ b/client/ayon_nuke/startup/init.py @@ -0,0 +1,5 @@ +from ayon_core.pipeline import install_host +from ayon_nuke.api import NukeHost + +host = NukeHost() +install_host(host) diff --git a/client/ayon_nuke/startup/menu.py b/client/ayon_nuke/startup/menu.py index c3dd8cda8f..f36cd46467 100644 --- a/client/ayon_nuke/startup/menu.py +++ b/client/ayon_nuke/startup/menu.py @@ -1,5 +1,4 @@ -from ayon_core.pipeline import install_host -from ayon_nuke.api import NukeHost +from ayon_core.pipeline import registered_host -host = NukeHost() -install_host(host) +nuke_host = registered_host() +nuke_host.setup_menu() From bcddf6a0411739d5c11f5346046e114ee19600c6 Mon Sep 17 00:00:00 2001 From: Robin De Lillo Date: Tue, 3 Mar 2026 09:45:20 +0100 Subject: [PATCH 02/10] Apply suggestions from code review Co-authored-by: Roy Nieterau --- client/ayon_nuke/api/push_to_project.py | 2 +- client/ayon_nuke/api/utils.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client/ayon_nuke/api/push_to_project.py b/client/ayon_nuke/api/push_to_project.py index 999d41885b..63d0e5c102 100644 --- a/client/ayon_nuke/api/push_to_project.py +++ b/client/ayon_nuke/api/push_to_project.py @@ -46,7 +46,7 @@ def bake_container(container): def main(): if not nuke.GUI: - raise RuntimeError("Invalid in none-GUI mode.") + raise RuntimeError("Invalid in non-GUI mode.") from ayon_core.tools import context_dialog context = context_dialog.ask_for_context() diff --git a/client/ayon_nuke/api/utils.py b/client/ayon_nuke/api/utils.py index 91137b6e7f..c2dc949cff 100644 --- a/client/ayon_nuke/api/utils.py +++ b/client/ayon_nuke/api/utils.py @@ -121,7 +121,7 @@ def _submit_render_on_farm(node) -> bool: node (Node): The node for which the farm submission is being made. Returns: - bool. Has the submission succeed? + bool: Did the submission succeed? """ host = registered_host() From 8fa1a82f553cd75292538d218b798916cd53aa4e Mon Sep 17 00:00:00 2001 From: "robin@ynput.io" Date: Tue, 3 Mar 2026 09:47:02 +0100 Subject: [PATCH 03/10] Fix typo. --- client/ayon_nuke/api/lib.py | 2 +- client/ayon_nuke/api/pipeline.py | 4 ++-- client/ayon_nuke/api/push_to_project.py | 2 +- client/ayon_nuke/api/workfile_template_builder.py | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/client/ayon_nuke/api/lib.py b/client/ayon_nuke/api/lib.py index ac0a0f3dad..8bea360b76 100644 --- a/client/ayon_nuke/api/lib.py +++ b/client/ayon_nuke/api/lib.py @@ -2498,7 +2498,7 @@ def _launch_workfile_app(): # Safeguard to not show window when application is still starting up # or is already closing down. if not nuke.GUI: - raise RuntimeError("Invalid in non-GUI mode.") + raise RuntimeError("Invalid in none-GUI mode.") closing_down = QtWidgets.QApplication.closingDown() starting_up = QtWidgets.QApplication.startingUp() diff --git a/client/ayon_nuke/api/pipeline.py b/client/ayon_nuke/api/pipeline.py index b37fc28abf..f3881be713 100644 --- a/client/ayon_nuke/api/pipeline.py +++ b/client/ayon_nuke/api/pipeline.py @@ -142,7 +142,7 @@ def install(self): def setup_menu(self): """Setup AYON menus.""" if not nuke.GUI: - raise RuntimeError("Cannot set up menus in non-GUI mode.") + raise RuntimeError("Cannot set up menus in none-GUI mode.") project_settings = get_current_project_settings() _install_menu(project_settings) @@ -228,7 +228,7 @@ def get_context_label(): def _install_menu(project_settings: dict): """Install AYON menu into Nuke's main menu bar.""" - # local imports, modules not available in non-GUI mode + # local imports, modules not available in none-GUI mode from ayon_core.tools.utils import host_tools from ayon_core.tools.workfile_template_build import open_template_ui diff --git a/client/ayon_nuke/api/push_to_project.py b/client/ayon_nuke/api/push_to_project.py index 63d0e5c102..999d41885b 100644 --- a/client/ayon_nuke/api/push_to_project.py +++ b/client/ayon_nuke/api/push_to_project.py @@ -46,7 +46,7 @@ def bake_container(container): def main(): if not nuke.GUI: - raise RuntimeError("Invalid in non-GUI mode.") + raise RuntimeError("Invalid in none-GUI mode.") from ayon_core.tools import context_dialog context = context_dialog.ask_for_context() diff --git a/client/ayon_nuke/api/workfile_template_builder.py b/client/ayon_nuke/api/workfile_template_builder.py index 4b1e225e84..f41285ed45 100644 --- a/client/ayon_nuke/api/workfile_template_builder.py +++ b/client/ayon_nuke/api/workfile_template_builder.py @@ -121,7 +121,7 @@ def update_workfile_template(*args): def create_placeholder(*args): if not nuke.GUI: - raise RuntimeError("Invalid in non-GUI mode.") + raise RuntimeError("Invalid in none-GUI mode.") from ayon_core.tools.workfile_template_build import ( WorkfileBuildPlaceholderDialog, @@ -136,7 +136,7 @@ def create_placeholder(*args): def update_placeholder(*args): if not nuke.GUI: - raise RuntimeError("Invalid in non-GUI mode.") + raise RuntimeError("Invalid in none-GUI mode.") from ayon_core.tools.workfile_template_build import ( WorkfileBuildPlaceholderDialog, From 8a129d9b9616936d57b8ab003e0c63d4d82260e9 Mon Sep 17 00:00:00 2001 From: "robin@ynput.io" Date: Tue, 3 Mar 2026 12:55:53 +0100 Subject: [PATCH 04/10] Improve AYON host install on the farm from feedback. --- client/ayon_nuke/api/pipeline.py | 46 ++++++++++++++++++-------------- client/ayon_nuke/startup/init.py | 18 +++++++++++-- client/ayon_nuke/startup/menu.py | 8 +++++- 3 files changed, 49 insertions(+), 23 deletions(-) diff --git a/client/ayon_nuke/api/pipeline.py b/client/ayon_nuke/api/pipeline.py index f3881be713..eeb52d27d3 100644 --- a/client/ayon_nuke/api/pipeline.py +++ b/client/ayon_nuke/api/pipeline.py @@ -133,22 +133,22 @@ def install(self): # Register AYON event for workfiles loading. register_event_callback("workio.open_file", check_inventory_versions) register_event_callback("taskChanged", change_context_label) - project_settings = get_current_project_settings() - - add_nuke_callbacks(project_settings) - launch_workfiles_app() + add_nuke_callbacks() - def setup_menu(self): + def setup_ui_callbacks_and_menu(self): """Setup AYON menus.""" if not nuke.GUI: - raise RuntimeError("Cannot set up menus in none-GUI mode.") + raise RuntimeError("Cannot set up in none-GUI mode.") project_settings = get_current_project_settings() _install_menu(project_settings) add_scripts_menu() add_scripts_gizmo() + add_nuke_ui_callbacks() + launch_workfiles_app() + def get_context_data(self): root_node = nuke.root() return get_node_data(root_node, ROOT_DATA_KNOB) @@ -166,32 +166,38 @@ def add_nuke_callbacks(project_settings: dict = None): nuke_settings = project_settings["nuke"] workfile_settings = WorkfileSettings() - # Set context settings. + # Set context settings on create and script load. nuke.addOnCreate( - workfile_settings.set_context_settings, nodeClass="Root") + workfile_settings.set_context_settings, + nodeClass="Root" + ) + nuke.addOnScriptLoad(workfile_settings.set_context_settings) + + # fix ffmpeg settings on script + nuke.addOnScriptLoad(on_script_load) + + # Add dirmap for file paths. + if nuke_settings["dirmap"]["enabled"]: + log.info("Added Nuke's dir-mapping callback ...") + nuke.addFilenameFilter(dirmap_file_name_filter) + log.info("Added Nuke callbacks ...") + + +def add_nuke_ui_callbacks(): + """Adding all available UI nuke callbacks""" # adding favorites to file browser + workfile_settings = WorkfileSettings() nuke.addOnCreate(workfile_settings.set_favorites, nodeClass="Root") # template builder callbacks nuke.addOnCreate(start_workfile_template_builder, nodeClass="Root") - # fix ffmpeg settings on script - nuke.addOnScriptLoad(on_script_load) - # set checker for last versions on loaded containers nuke.addOnScriptLoad(check_inventory_versions) nuke.addOnScriptSave(check_inventory_versions) - # set apply all workfile settings on script load and save - nuke.addOnScriptLoad(WorkfileSettings().set_context_settings) - - if nuke_settings["dirmap"]["enabled"]: - log.info("Added Nuke's dir-mapping callback ...") - # Add dirmap for file paths. - nuke.addFilenameFilter(dirmap_file_name_filter) - - log.info("Added Nuke callbacks ...") + log.info("Added Nuke UI callbacks ...") def reload_config(): diff --git a/client/ayon_nuke/startup/init.py b/client/ayon_nuke/startup/init.py index c3dd8cda8f..86396c30c0 100644 --- a/client/ayon_nuke/startup/init.py +++ b/client/ayon_nuke/startup/init.py @@ -1,5 +1,19 @@ from ayon_core.pipeline import install_host from ayon_nuke.api import NukeHost -host = NukeHost() -install_host(host) +# Attempt to register host. +try: + host = NukeHost() + install_host(host) + +# Current environment might not be 100% fully AYON compatible. +# e.g. on farm, using Deadline or RoyalRender native Nuke plugin. +# If an incomplete AYON environment is provided, the host +# will not be able to install. +# We still allow Nuke to start as-is, might be enough for rendering. +# Otherwise it'll raise on AYON dependency with more meaningful error. +except Exception as error: + print( + f"Cannot initialize AYON Nuke host: {error}. " + "This might result in unexpected results." + ) diff --git a/client/ayon_nuke/startup/menu.py b/client/ayon_nuke/startup/menu.py index f36cd46467..43e5da8497 100644 --- a/client/ayon_nuke/startup/menu.py +++ b/client/ayon_nuke/startup/menu.py @@ -1,4 +1,10 @@ from ayon_core.pipeline import registered_host + +# This code gets only called from GUI mode. +# Unlike the farm, we do exepct a valid registered host at this time. nuke_host = registered_host() -nuke_host.setup_menu() +if nuke_host is None: + raise RuntimeError("Cannot find expected registered Nuke host.") + +nuke_host.setup_ui_callbacks_and_menu() From 7a06716aa1eaf5e461e1537cb5211b375e5bea51 Mon Sep 17 00:00:00 2001 From: "robin@ynput.io" Date: Tue, 3 Mar 2026 13:04:14 +0100 Subject: [PATCH 05/10] Fix typo. --- client/ayon_nuke/startup/menu.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client/ayon_nuke/startup/menu.py b/client/ayon_nuke/startup/menu.py index 43e5da8497..c39c01f81e 100644 --- a/client/ayon_nuke/startup/menu.py +++ b/client/ayon_nuke/startup/menu.py @@ -2,7 +2,8 @@ # This code gets only called from GUI mode. -# Unlike the farm, we do exepct a valid registered host at this time. +# Unlike the none-GUI mode (e.g. farm), +# we do expect a valid host at this time. nuke_host = registered_host() if nuke_host is None: raise RuntimeError("Cannot find expected registered Nuke host.") From 2f748327d7744a4534dbd7a3070190a6e0661da8 Mon Sep 17 00:00:00 2001 From: Roy Nieterau Date: Wed, 4 Mar 2026 21:54:46 +0100 Subject: [PATCH 06/10] Apply suggestion from @BigRoy --- client/ayon_nuke/api/lib.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/ayon_nuke/api/lib.py b/client/ayon_nuke/api/lib.py index 8bea360b76..ac0a0f3dad 100644 --- a/client/ayon_nuke/api/lib.py +++ b/client/ayon_nuke/api/lib.py @@ -2498,7 +2498,7 @@ def _launch_workfile_app(): # Safeguard to not show window when application is still starting up # or is already closing down. if not nuke.GUI: - raise RuntimeError("Invalid in none-GUI mode.") + raise RuntimeError("Invalid in non-GUI mode.") closing_down = QtWidgets.QApplication.closingDown() starting_up = QtWidgets.QApplication.startingUp() From 73c4acf5b8172835f74856b94fc508a45f418ffb Mon Sep 17 00:00:00 2001 From: Roy Nieterau Date: Wed, 4 Mar 2026 21:56:18 +0100 Subject: [PATCH 07/10] `none-GUI` -> `non-GUI` --- client/ayon_nuke/api/pipeline.py | 4 ++-- client/ayon_nuke/api/push_to_project.py | 2 +- client/ayon_nuke/api/workfile_template_builder.py | 4 ++-- client/ayon_nuke/startup/menu.py | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/client/ayon_nuke/api/pipeline.py b/client/ayon_nuke/api/pipeline.py index eeb52d27d3..2b4c76b49e 100644 --- a/client/ayon_nuke/api/pipeline.py +++ b/client/ayon_nuke/api/pipeline.py @@ -139,7 +139,7 @@ def install(self): def setup_ui_callbacks_and_menu(self): """Setup AYON menus.""" if not nuke.GUI: - raise RuntimeError("Cannot set up in none-GUI mode.") + raise RuntimeError("Cannot set up in non-GUI mode.") project_settings = get_current_project_settings() _install_menu(project_settings) @@ -234,7 +234,7 @@ def get_context_label(): def _install_menu(project_settings: dict): """Install AYON menu into Nuke's main menu bar.""" - # local imports, modules not available in none-GUI mode + # local imports, modules not available in non-GUI mode from ayon_core.tools.utils import host_tools from ayon_core.tools.workfile_template_build import open_template_ui diff --git a/client/ayon_nuke/api/push_to_project.py b/client/ayon_nuke/api/push_to_project.py index 999d41885b..63d0e5c102 100644 --- a/client/ayon_nuke/api/push_to_project.py +++ b/client/ayon_nuke/api/push_to_project.py @@ -46,7 +46,7 @@ def bake_container(container): def main(): if not nuke.GUI: - raise RuntimeError("Invalid in none-GUI mode.") + raise RuntimeError("Invalid in non-GUI mode.") from ayon_core.tools import context_dialog context = context_dialog.ask_for_context() diff --git a/client/ayon_nuke/api/workfile_template_builder.py b/client/ayon_nuke/api/workfile_template_builder.py index f41285ed45..4b1e225e84 100644 --- a/client/ayon_nuke/api/workfile_template_builder.py +++ b/client/ayon_nuke/api/workfile_template_builder.py @@ -121,7 +121,7 @@ def update_workfile_template(*args): def create_placeholder(*args): if not nuke.GUI: - raise RuntimeError("Invalid in none-GUI mode.") + raise RuntimeError("Invalid in non-GUI mode.") from ayon_core.tools.workfile_template_build import ( WorkfileBuildPlaceholderDialog, @@ -136,7 +136,7 @@ def create_placeholder(*args): def update_placeholder(*args): if not nuke.GUI: - raise RuntimeError("Invalid in none-GUI mode.") + raise RuntimeError("Invalid in non-GUI mode.") from ayon_core.tools.workfile_template_build import ( WorkfileBuildPlaceholderDialog, diff --git a/client/ayon_nuke/startup/menu.py b/client/ayon_nuke/startup/menu.py index c39c01f81e..53e89d68b5 100644 --- a/client/ayon_nuke/startup/menu.py +++ b/client/ayon_nuke/startup/menu.py @@ -2,7 +2,7 @@ # This code gets only called from GUI mode. -# Unlike the none-GUI mode (e.g. farm), +# Unlike the non-GUI mode (e.g. farm), # we do expect a valid host at this time. nuke_host = registered_host() if nuke_host is None: From 1994f2e553547faf6851d897aa5074d860c8194f Mon Sep 17 00:00:00 2001 From: Roy Nieterau Date: Wed, 4 Mar 2026 22:03:18 +0100 Subject: [PATCH 08/10] Fix missing space in log message --- client/ayon_nuke/api/lib.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/ayon_nuke/api/lib.py b/client/ayon_nuke/api/lib.py index ac0a0f3dad..50bb862f9d 100644 --- a/client/ayon_nuke/api/lib.py +++ b/client/ayon_nuke/api/lib.py @@ -1587,7 +1587,7 @@ def set_viewers_colorspace(self, imageio_nuke): if erased_viewers: log.warning( - "Attention! Viewer nodes {} were erased." + "Attention! Viewer nodes {} were erased. " "It had wrong color profile".format(erased_viewers)) # TODO: move into ./colorspace.py From fb7d93639b4c4199d6920592986640137d64d8f4 Mon Sep 17 00:00:00 2001 From: "robin@ynput.io" Date: Wed, 11 Mar 2026 17:33:26 +0100 Subject: [PATCH 09/10] Adjust callbacks --- client/ayon_nuke/api/pipeline.py | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/client/ayon_nuke/api/pipeline.py b/client/ayon_nuke/api/pipeline.py index 3a36d731f3..96fb32b08b 100644 --- a/client/ayon_nuke/api/pipeline.py +++ b/client/ayon_nuke/api/pipeline.py @@ -134,19 +134,17 @@ def install(self): register_event_callback("workio.open_file", check_inventory_versions) register_event_callback("taskChanged", change_context_label) - add_nuke_callbacks() - def setup_ui_callbacks_and_menu(self): """Setup AYON menus.""" if not nuke.GUI: raise RuntimeError("Cannot set up in non-GUI mode.") project_settings = get_current_project_settings() + add_nuke_callbacks(project_settings) _install_menu(project_settings) + add_scripts_menu() add_scripts_gizmo() - - add_nuke_ui_callbacks() launch_workfiles_app() def get_context_data(self): @@ -166,7 +164,7 @@ def add_nuke_callbacks(project_settings: dict = None): nuke_settings = project_settings["nuke"] workfile_settings = WorkfileSettings() - # Set context settings on create and script load. + # Set context settings. nuke.addOnCreate( workfile_settings.set_context_settings, nodeClass="Root" @@ -181,12 +179,6 @@ def add_nuke_callbacks(project_settings: dict = None): log.info("Added Nuke's dir-mapping callback ...") nuke.addFilenameFilter(dirmap_file_name_filter) - log.info("Added Nuke callbacks ...") - - -def add_nuke_ui_callbacks(): - """Adding all available UI nuke callbacks""" - # adding favorites to file browser workfile_settings = WorkfileSettings() nuke.addOnCreate(workfile_settings.set_favorites, nodeClass="Root") @@ -197,7 +189,7 @@ def add_nuke_ui_callbacks(): nuke.addOnScriptLoad(check_inventory_versions) nuke.addOnScriptSave(check_inventory_versions) - log.info("Added Nuke UI callbacks ...") + log.info("Added Nuke callbacks ...") def reload_config(): From d4ea4b60985eb4fea83135fbdbcf7c9344094835 Mon Sep 17 00:00:00 2001 From: "robin@ynput.io" Date: Wed, 11 Mar 2026 17:36:16 +0100 Subject: [PATCH 10/10] Adjust callbacks --- client/ayon_nuke/api/pipeline.py | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/client/ayon_nuke/api/pipeline.py b/client/ayon_nuke/api/pipeline.py index 96fb32b08b..bce6ed6bc4 100644 --- a/client/ayon_nuke/api/pipeline.py +++ b/client/ayon_nuke/api/pipeline.py @@ -166,29 +166,29 @@ def add_nuke_callbacks(project_settings: dict = None): # Set context settings. nuke.addOnCreate( - workfile_settings.set_context_settings, - nodeClass="Root" - ) - nuke.addOnScriptLoad(workfile_settings.set_context_settings) + workfile_settings.set_context_settings, nodeClass="Root") - # fix ffmpeg settings on script - nuke.addOnScriptLoad(on_script_load) - - # Add dirmap for file paths. - if nuke_settings["dirmap"]["enabled"]: - log.info("Added Nuke's dir-mapping callback ...") - nuke.addFilenameFilter(dirmap_file_name_filter) - - workfile_settings = WorkfileSettings() + # adding favorites to file browser nuke.addOnCreate(workfile_settings.set_favorites, nodeClass="Root") # template builder callbacks nuke.addOnCreate(start_workfile_template_builder, nodeClass="Root") + # fix ffmpeg settings on script + nuke.addOnScriptLoad(on_script_load) + # set checker for last versions on loaded containers nuke.addOnScriptLoad(check_inventory_versions) nuke.addOnScriptSave(check_inventory_versions) + # set apply all workfile settings on script load and save + nuke.addOnScriptLoad(WorkfileSettings().set_context_settings) + + if nuke_settings["dirmap"]["enabled"]: + log.info("Added Nuke's dir-mapping callback ...") + # Add dirmap for file paths. + nuke.addFilenameFilter(dirmap_file_name_filter) + log.info("Added Nuke callbacks ...")