Conversation
Introduces the ability to define intermediate outputs via file extension or custom write knobs. Includes a validator to ensure unique names for custom knobs and organizes the UI into sections.
…with-more-robust-config
…the knob value type
There was a problem hiding this comment.
Pull request overview
Adds an output-definition mode for intermediate review outputs so presets can either rely on the file extension or drive a Nuke Write node via a configurable list of custom write knobs.
Changes:
- Adds
output_typeandcustom_write_knobsto the intermediate output settings model and updates the default preset values. - Updates the intermediate extraction plugin to pass the full output settings into the MOV exporter.
- Extends the MOV exporter to derive the output extension and apply write-node knob configuration based on
output_type.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
server/settings/publish_plugins.py |
Adds output_type + custom_write_knobs to intermediate output settings and updates defaults/UI grouping. |
client/ayon_nuke/plugins/publish/extract_review_intermediates.py |
Passes full output settings dict into ExporterReviewMov instead of only the extension. |
client/ayon_nuke/api/plugin.py |
Updates ExporterReviewMov to select extension and write-node knob behavior based on output_type. |
Suppressed comments (2)
client/ayon_nuke/api/plugin.py:1425
generate_movassumesself.settings["output_type"]always exists. If older settings omit it, this raisesKeyErrorand breaks the stated fallback-to-extension behavior. Treat any missing/unknown value as the extension path.
if self.settings["output_type"] == "extension":
client/ayon_nuke/api/plugin.py:1456
- When
output_typeiscustom_write_knobs, iteratingself.settings["custom_write_knobs"]will raiseKeyErrorif the list is missing (e.g. migrated/hand-edited settings). Default to an empty list.
for knob in self.settings["custom_write_knobs"]:
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
Suppressed comments (3)
client/ayon_nuke/api/plugin.py:1474
- In the Write-knob application loop, the
excepthandler logsknob['name'], butknob['name']can itself be missing/invalid (e.g. malformed settings data), which would raise a newKeyErrorand mask the original exception. Useknob.get('name', ...)(and ideallyknob.get('type')) in both the try and except paths so malformed entries fail gracefully.
for knob in self.settings.get("custom_write_knobs") or []:
try:
if knob["type"] == "text":
write_node[knob["name"]].setValue(str(knob["text"]))
elif knob["type"] == "number":
write_node[knob["name"]].setValue(int(knob["number"]))
elif knob["type"] == "decimal_number":
write_node[knob["name"]].setValue(float(knob["decimal_number"]))
elif knob["type"] == "boolean":
write_node[knob["name"]].setValue(bool(knob["boolean"]))
else:
self.log.warning(
f"Knob type `{knob['type']}` is not supported"
)
except Exception:
self.log.info(
f"`{knob['name']}` knob was not found on Write node"
)
client/ayon_nuke/api/plugin.py:1212
- When
output_type == 'custom_write_knobs', the extension is derived fromcustom_write_knobsviaknob['name']/knob['text']. If an entry is missing keys or is not a mapping, this will raise and prevent intermediate export entirely. Using.get(...)makes the behavior robust against older/malformed presets.
This issue also appears on line 1456 of the same file.
output_type = self.settings.get("output_type", "extension")
if output_type == "custom_write_knobs":
for knob in self.settings.get("custom_write_knobs") or []:
if knob["name"] == "file_type":
self.ext = knob["text"] or "mov"
break
server/settings/publish_plugins.py:203
custom_write_knobsuses the sharedKnobModel, which allows many knobtypevalues (e.g.vector_2d,vector_3d,color,expression). However,ExporterReviewMov.generate_movcurrently only appliestext,number,decimal_number, andbooleanand warns for everything else. This means the settings UI will allow creating configurations that are silently ignored at export time. Consider restricting the allowed knob types for this specific field (or extending the exporter to support the additional types).
custom_write_knobs: list[KnobModel] = SettingsField(
default_factory=list,
title="Custom Write Knobs",
section="Output definition",
)
Co-authored-by: Jakub Ježek <jakubjezek001@gmail.com>
|
anyway I was testing the code on some example use cases and all was working as expected. Once the code is cleared it will be Approvable. |
There was a problem hiding this comment.
Tested locally and it worked with mxf, mov and jpg.
Note that I had an issue with single-frame image sequence in Extract Review but I don't think it comes from this PR more that it revealed it.
DEBUG: New representation tags: `['baking', 'review', 'ftrackreview', 'kitsureview', 'webreview']`
Traceback (most recent call last):
File "C:\Users\robin\AppData\Local\Ynput\AYON\dependency_packages\ayon_2607151723_windows.zip\dependencies\pyblish\plugin.py", line 528, in __explicit_process
runner(*args)
File "C:\Users\robin\OneDrive\Bureau\dev_ayon\dev\ayon-core\client\ayon_core\plugins\publish\extract_review.py", line 173, in process
self.main_process(instance)
File "C:\Users\robin\OneDrive\Bureau\dev_ayon\dev\ayon-core\client\ayon_core\plugins\publish\extract_review.py", line 407, in main_process
self._render_output_definitions(
File "C:\Users\robin\OneDrive\Bureau\dev_ayon\dev\ayon-core\client\ayon_core\plugins\publish\extract_review.py", line 482, in _render_output_definitions
temp_data = self.prepare_temp_data(instance, repre, output_def)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\robin\OneDrive\Bureau\dev_ayon\dev\ayon-core\client\ayon_core\plugins\publish\extract_review.py", line 710, in prepare_temp_data
input_frames = list(sorted(cols[0].indexes))
~~~~^^^
IndexError: list index out of range
publish-report-260810-15-08.json
Once Roy's feedback is addressed, I'm happy to approve and merge this one if this needs to be tackled as a separate PR.
BigRoy
left a comment
There was a problem hiding this comment.
Settings conversion now works, nice! :)
I do have some remaining mostly cosmetic notes.
Co-authored-by: Roy Nieterau <roy_nieterau@hotmail.com>
…st-config' of https://github.com/ynput/ayon-nuke into enhancement/YN-0771-intermediate-presets-with-more-robust-config
7e7f7d1 to
174f0b3
Compare
…1-intermediate-presets-with-more-robust-config

Introduces an
output_typefield onIntermediateOutputModelto choose between file-extension or custom write knobs. Includes a validator that enforces unique names on the knob list and reorganizes fields into their own sections.Changelog Description
Adds output type selection (extension vs custom write knobs) for intermediate presets. The new
output_typefield determines how output is written, with a fallback to "Defined by extension". Includes a validator ensuring unique names in the custom write knobs list and a reformat-nodes config that stores its data as a subfolder of representation files.Additional review information
The changes focus on:
New
output_typefield — A new enum-like resolver with two preset values ("Defined by extension", "Defined by custom write knobs") is added to the model, defaulting to extension. The corresponding data in the reformat nodes config is stored as a subfolder of representation files and written viaCustomWriteKnobsManagerfor proper serialization.Validation — A validator on the
custom_write_knobslist ensures unique names are preserved at runtime.UI organization — Related fields (output_type, custom_write_knobs) live under "Output definition" and add_custom_tags/extension/fill_missing_frames stay under "Representation definition".
Testing notes:
CustomWriteKnobsManagerserialization works correctlyDependency
Close ynput/ayon-nuke#343
Related support tickets
YN-0771