Skip to content

Add context reset prompt on taskChange#266

Open
sebastianbrandhuber wants to merge 10 commits into
ynput:developfrom
sebastianbrandhuber:enhancement/265-add_context_reset_prompt_on_task_change
Open

Add context reset prompt on taskChange#266
sebastianbrandhuber wants to merge 10 commits into
ynput:developfrom
sebastianbrandhuber:enhancement/265-add_context_reset_prompt_on_task_change

Conversation

@sebastianbrandhuber

@sebastianbrandhuber sebastianbrandhuber commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Changelog Description

This PR implements a pop-up dialog that allows users to interactively choose whether, and what, should be adapted to the new context before a context change callback - very similar to its counterpart in ayon-houdini.

Additional review information

Additional information can be found here in the issue itself:
Fix #265

Testing notes:

  1. Start nuke, save a scene with the workfiles tool.
  2. (Optional) Create a write instance
  3. Using the workfiles tools, save this existing scene into a different context
  4. A dialog shows up and lets the user choose what should be adapted to the new context.

Current limitations and unintended bahaviour:

  • The product name of the instance does not get updated automatically - visible in the publish dialog.
  • The node name of the instance node does not get updated
  • The instance node's group children are not being renamed aswell.

Comment thread client/ayon_nuke/api/lib.py Outdated

@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 - very nice! Code looks very close to similar functionality in e.g. Maya, Houdini and Fusion integration - and I like such consistency!

@BigRoy BigRoy requested review from jakubjezek001 and rdelillo June 10, 2026 20:29
@BigRoy BigRoy added type: enhancement Improvement of existing functionality or minor addition community Issues and PRs coming from the community members labels Jun 10, 2026
Comment thread client/ayon_nuke/api/lib.py Outdated
@sebastianbrandhuber sebastianbrandhuber marked this pull request as ready for review June 18, 2026 07:49
@sebastianbrandhuber sebastianbrandhuber changed the title first draft: setup context reset prompt on taskChange Add context reset prompt on taskChange Jun 18, 2026
Comment thread client/ayon_nuke/api/lib.py Outdated
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
sebastianbrandhuber and others added 4 commits June 18, 2026 10:46
Co-authored-by: Roy Nieterau <roy_nieterau@hotmail.com>
Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com>

change_context_label()

if _about_to_save:

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.

Also pointing out that there is also _before_workfile_save and _after_workfile_save on IWorkfileHost so you can store the _about_to_save on the host itself too.

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.

@sebastianbrandhuber I assume this is a change still to do?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, will implement this next week when back at work 👍

@BigRoy BigRoy requested a review from moonyuet June 23, 2026 07:30
@BigRoy

BigRoy commented Jun 23, 2026

Copy link
Copy Markdown
Member

@moonyuet could you give this a thorough stress test? :)

@moonyuet moonyuet 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.

The context change is successfully when switching folder and task. but failed to save the workfile.

Recording.2026-06-23.173638.mp4

Error log:

Traceback (most recent call last):
  File "<string>", line 9, in <module>
  File "C:\Users\Kayla\AppData\Local\Ynput\AYON\addons\core_1.9.6+dev-ayon-ui-qt-launcher\ayon_core\pipeline\create\context.py", line 287, in __init__
    self.reset(discover_publish_plugins)
  File "C:\Users\Kayla\AppData\Local\Ynput\AYON\addons\core_1.9.6+dev-ayon-ui-qt-launcher\ayon_core\pipeline\create\context.py", line 580, in reset
    self.reset_instances()
  File "C:\Users\Kayla\AppData\Local\Ynput\AYON\addons\core_1.9.6+dev-ayon-ui-qt-launcher\ayon_core\pipeline\create\context.py", line 1591, in reset_instances
    raise CreatorsCollectionFailed(failed_info)
ayon_core.pipeline.create.exceptions.CreatorsCollectionFailed: Failed to collect instances

Comment thread client/ayon_nuke/api/lib.py Outdated
@BigRoy

BigRoy commented Jun 23, 2026

Copy link
Copy Markdown
Member
Traceback (most recent call last):
  File "<string>", line 9, in <module>
  File "C:\Users\Kayla\AppData\Local\Ynput\AYON\addons\core_1.9.6+dev-ayon-ui-qt-launcher\ayon_core\pipeline\create\context.py", line 287, in __init__
    self.reset(discover_publish_plugins)
  File "C:\Users\Kayla\AppData\Local\Ynput\AYON\addons\core_1.9.6+dev-ayon-ui-qt-launcher\ayon_core\pipeline\create\context.py", line 580, in reset
    self.reset_instances()
  File "C:\Users\Kayla\AppData\Local\Ynput\AYON\addons\core_1.9.6+dev-ayon-ui-qt-launcher\ayon_core\pipeline\create\context.py", line 1591, in reset_instances
    raise CreatorsCollectionFailed(failed_info)
ayon_core.pipeline.create.exceptions.CreatorsCollectionFailed: Failed to collect instances

That sounds quite weird. Does the publisher UI refresh without errors before the save change? And does it still open publisher UI fine after?

It's weird it fails on collecting instances, but doesn't in stack trace tell us what it actually errors on.

@moonyuet

Copy link
Copy Markdown
Member
Traceback (most recent call last):
  File "<string>", line 9, in <module>
  File "C:\Users\Kayla\AppData\Local\Ynput\AYON\addons\core_1.9.6+dev-ayon-ui-qt-launcher\ayon_core\pipeline\create\context.py", line 287, in __init__
    self.reset(discover_publish_plugins)
  File "C:\Users\Kayla\AppData\Local\Ynput\AYON\addons\core_1.9.6+dev-ayon-ui-qt-launcher\ayon_core\pipeline\create\context.py", line 580, in reset
    self.reset_instances()
  File "C:\Users\Kayla\AppData\Local\Ynput\AYON\addons\core_1.9.6+dev-ayon-ui-qt-launcher\ayon_core\pipeline\create\context.py", line 1591, in reset_instances
    raise CreatorsCollectionFailed(failed_info)
ayon_core.pipeline.create.exceptions.CreatorsCollectionFailed: Failed to collect instances

That sounds quite weird. Does the publisher UI refresh without errors before the save change? And does it still open publisher UI fine after?

It's weird it fails on collecting instances, but doesn't in stack trace tell us what it actually errors on.

It does have error from ayon-deadline-cloud, I will try to disabled that plugins and test if it is related.

@moonyuet moonyuet 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.

Tested successfully in Nuke 16.0

@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.

All looks good - just pending the change requested here next week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community Issues and PRs coming from the community members type: enhancement Improvement of existing functionality or minor addition

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add nuke context reset prompt on taskChange

5 participants