Skip to content

Add the options to enable context and its related settings - #336

Merged
moonyuet merged 22 commits into
developfrom
enhancement/decouple_callback_for_general_context_settings
Aug 4, 2026
Merged

Add the options to enable context and its related settings#336
moonyuet merged 22 commits into
developfrom
enhancement/decouple_callback_for_general_context_settings

Conversation

@moonyuet

Copy link
Copy Markdown
Member

Changelog Description

This PR is to add the options to enable and its related settings through the addon settings.
Throughout this PR, users can also choose whether enabling to set context settings during callbacks.

Additional review information

Marked it as draft, we need to discuss whether better designs for the setting needed for this.

Testing notes:

  1. Launch Nuke
  2. Toggle the settings from ayon+settings://nuke/general/settings_to_apply in AYON server

@moonyuet
moonyuet requested review from BigRoy and rdelillo July 23, 2026 06:01
@moonyuet moonyuet self-assigned this Jul 23, 2026
@moonyuet moonyuet added the type: enhancement Improvement of existing functionality or minor addition label Jul 23, 2026
@moonyuet

Copy link
Copy Markdown
Member Author

@rdelillo @BigRoy I split the callbacks regarding to #211. I know there is another PR #193 which does the same thing on the context setting, and I will merge the changes (mainly for the context setting) once it is merged.

Comment thread client/ayon_nuke/api/lib.py Outdated
Comment thread client/ayon_nuke/api/pipeline.py Outdated
Comment thread client/ayon_nuke/api/pipeline.py Outdated
Comment thread server/settings/general.py Outdated
Comment thread client/ayon_nuke/api/lib.py Outdated
Comment thread client/ayon_nuke/api/lib.py Outdated
@moonyuet
moonyuet requested a review from BigRoy July 24, 2026 08:14
Comment thread server/settings/general.py Outdated
Comment thread client/ayon_nuke/api/pipeline.py Outdated
Comment thread client/ayon_nuke/api/pipeline.py Outdated
@moonyuet
moonyuet requested a review from rdelillo July 30, 2026 06:48
Comment thread client/ayon_nuke/api/pipeline.py Outdated
@moonyuet
moonyuet requested a review from BigRoy July 30, 2026 09:13
@moonyuet
moonyuet marked this pull request as ready for review July 31, 2026 07:56

@BigRoy BigRoy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Some small notes left.

Comment thread client/ayon_nuke/api/pipeline.py Outdated
Comment thread client/ayon_nuke/api/pipeline.py Outdated
Comment thread client/ayon_nuke/api/pipeline.py Outdated
Comment thread server/settings/workfile_callbacks.py Outdated
@moonyuet
moonyuet requested a review from BigRoy August 3, 2026 08:36
Comment thread client/ayon_nuke/api/pipeline.py Outdated
Comment thread client/ayon_nuke/api/pipeline.py Outdated
Comment thread server/settings/workfile_callbacks.py
moonyuet and others added 3 commits August 3, 2026 21:31
Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com>
Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com>
Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com>

@rdelillo rdelillo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving this one cause it works as expected and it's very convenient to be able to switch callbacks individually like that 💪
Tested on Nuke 17.0, I disabled callbacks on create and enabled on open.

Small Notes:

  • Need to fix the lint
  • Is it a problem to always register 1 big function as callback that read the settings vs add granular functions as callbacks based on settings ? I don't see any issue and maybe safer for now, but just want to mention it.

@moonyuet

moonyuet commented Aug 3, 2026

Copy link
Copy Markdown
Member Author
  • Is it a problem to always register 1 big function as callback that read the settings vs add granular functions as callbacks based on settings ? I don't see any issue and maybe safer for now, but just want to mention it.

Not sure if there is any reason behind adding those functions explicitly as callbacks before. But in general(like in other hosts), we added the callback with its related function (new_callback would trigger the on_new function which did workfile template build, set context settings etc.). I think the nuke host should align with what we have done in terms of callback if possible.

@BigRoy

BigRoy commented Aug 3, 2026

Copy link
Copy Markdown
Member
  • Is it a problem to always register 1 big function as callback that read the settings vs add granular functions as callbacks based on settings ? I don't see any issue and maybe safer for now, but just want to mention it.

A problem in which way? I don't really see any issues with it either way. I prefer myself to just register a single thing to the DCC and then keep things in AYON land where we control it our way instead. If any of these ever need to run in a certain order, etc. we then know which order it's running in - if we register them with Nuke, I wouldn't know for example.

@BigRoy BigRoy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - just refactor on_root_load -> on_script_load.

Comment thread client/ayon_nuke/api/pipeline.py Outdated
@moonyuet
moonyuet merged commit d99efec into develop Aug 4, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: enhancement Improvement of existing functionality or minor addition

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants