Add a setting to suppress the minimum supported Nuke version Dialog#124
Add a setting to suppress the minimum supported Nuke version Dialog#124RicardoMusch wants to merge 4 commits into
Conversation
…s it blocks the startup of Nuke and makes this annoying in daily use.
…n the script. This is better than getting the context from the path as the path usually doesn't include the Task name/id.
Restore context from root knob
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #124 +/- ##
==========================================
- Coverage 20.03% 20.00% -0.04%
==========================================
Files 6 6
Lines 549 550 +1
==========================================
Hits 110 110
- Misses 439 440 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR persists the current ShotGrid/Toolkit context into a Nuke root knob on save and attempts to restore it on load, while also making the minimum-supported-version warning dialog configurable.
Changes:
- Store serialized Toolkit context into a
root.sgtk_contextknob on script save and deserialize it on script load. - Add helper to ensure the
sgtktab +sgtk_contextknob exist on the root node. - Add a new engine setting to optionally suppress the “minimum supported Nuke version” GUI warning dialog.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| python/tk_nuke/init.py | Add knob/tab creation + context serialization on save, and knob-based context restoration on load. |
| info.yml | Add configuration to enable/disable the minimum supported version warning dialog. |
| engine.py | Gate the minimum supported version warning dialog behind the new setting. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| logger.debug("Trying to get the context from the root.sgtk_context knob if it exists...") | ||
| # Try to get the context from the root.sgtk_context knob if it exists | ||
| root = nuke.root() | ||
| if "sgtk_context" in root.knobs(): | ||
| context_knob = root.knob("sgtk_context") | ||
| context_str_serialized = context_knob.value() | ||
| if context_str_serialized: | ||
| logger.debug("Found serialized context in knob: %s" % context_str_serialized) | ||
| try: | ||
| new_ctx = sgtk.Context.deserialize(context_str_serialized) | ||
| logger.debug("Deserialized context from knob: %r" % (new_ctx,)) | ||
| # Now switch to the context appropriate for the file | ||
| __engine_refresh(new_ctx) | ||
| return |
| context_str = new_ctx.serialize(with_user_credentials=False, use_json=False) | ||
| context_knob.setValue(context_str) | ||
| logger.debug("Updated 'sgtk_context' knob with value: %s" % context_str) |
| logger.debug("Found serialized context in knob: %s" % context_str_serialized) | ||
| try: | ||
| new_ctx = sgtk.Context.deserialize(context_str_serialized) | ||
| logger.debug("Deserialized context from knob: %r" % (new_ctx,)) |
| except Exception as e: | ||
| logger.exception("Failed to ensure 'sgtk' tab and 'sgtk_context' knob: %s", e) |
| """ | ||
| Flow Production Tracking no longer supports {product} versions older than | ||
| {version}. | ||
| You can continue to use Toolkit but you may experience bugs or instabilities. | ||
|
|
||
| For information regarding support engine versions, please visit this page: | ||
| {url_doc_supported_versions} | ||
| """.strip() |
| display_min_supported_version_warning_dialog: | ||
| type: bool | ||
| description: "Controls whether a warning should display if the nuke version is below the minimum supported, | ||
| but above the minimum required, version. Defaults to True. Set to False to disable the GUI |
Add a setting to suppress the minimum supported Nuke version Dialog.
This is required for usage in a Studio pipeline where we are aware of the "danger" of running into issues but should be able to suppress these dialogs for our users.
Reasons: