Skip to content

[YN-0771]: Adds output type selection for intermediate presets - #344

Merged
BigRoy merged 44 commits into
developfrom
enhancement/YN-0771-intermediate-presets-with-more-robust-config
Aug 12, 2026
Merged

BigRoy merged 44 commits into
developfrom
enhancement/YN-0771-intermediate-presets-with-more-robust-config

Conversation

@jakubjezek001

@jakubjezek001 jakubjezek001 commented Aug 3, 2026

Copy link
Copy Markdown
Member

Introduces an output_type field on IntermediateOutputModel to 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_type field 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_type field — 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 via CustomWriteKnobsManager for proper serialization.

  • Validation — A validator on the custom_write_knobs list 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:

  1. Open intermediate preset editor and verify the new "Output type" dropdown appears
  2. Test creating an intermediate with output_type set to custom write knobs and confirm CustomWriteKnobsManager serialization works correctly
  3. Test validation by adding duplicate names in the knob list
  4. Verify reformat-nodes data is written as subfolder of representation files

Dependency

Close ynput/ayon-nuke#343

Related support tickets

YN-0771

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.
@jakubjezek001 jakubjezek001 linked an issue Aug 3, 2026 that may be closed by this pull request
@jakubjezek001
jakubjezek001 removed the request for review from moonyuet August 3, 2026 14:17
@jakubjezek001 jakubjezek001 added the type: enhancement Improvement of existing functionality or minor addition label Aug 3, 2026
@jakubjezek001 jakubjezek001 changed the title Add output type selection to intermediate presets [YN-0771]: Adds output type selection (extension vs custom write knobs) for intermediate presets Aug 3, 2026
@jakubjezek001 jakubjezek001 changed the title [YN-0771]: Adds output type selection (extension vs custom write knobs) for intermediate presets [YN-0771]: Adds output type selection for intermediate presets Aug 3, 2026
@moonyuet
moonyuet marked this pull request as ready for review August 4, 2026 08:35
@moonyuet
moonyuet requested a review from Copilot August 4, 2026 08:35

Copilot AI 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.

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_type and custom_write_knobs to 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_mov assumes self.settings["output_type"] always exists. If older settings omit it, this raises KeyError and 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_type is custom_write_knobs, iterating self.settings["custom_write_knobs"] will raise KeyError if 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.

Comment thread client/ayon_nuke/api/plugin.py Outdated
Comment thread server/settings/publish_plugins.py Outdated
Comment thread server/settings/publish_plugins.py Outdated
Comment thread server/settings/publish_plugins.py
moonyuet and others added 4 commits August 4, 2026 16:40
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>

Copilot AI 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.

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 except handler logs knob['name'], but knob['name'] can itself be missing/invalid (e.g. malformed settings data), which would raise a new KeyError and mask the original exception. Use knob.get('name', ...) (and ideally knob.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 from custom_write_knobs via knob['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_knobs uses the shared KnobModel, which allows many knob type values (e.g. vector_2d, vector_3d, color, expression). However, ExporterReviewMov.generate_mov currently only applies text, number, decimal_number, and boolean and 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",
    )

@moonyuet
moonyuet requested a review from rdelillo August 4, 2026 08:57
Comment thread client/ayon_nuke/api/plugin.py Outdated
Comment thread client/ayon_nuke/api/plugin.py Outdated
Comment thread client/ayon_nuke/api/plugin.py Outdated
Comment thread client/ayon_nuke/api/plugin.py Outdated
Comment thread server/settings/publish_plugins.py Outdated
Co-authored-by: Jakub Ježek <jakubjezek001@gmail.com>
@jakubjezek001

Copy link
Copy Markdown
Member Author

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.

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

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.

Comment thread server/settings/conversion.py Outdated
@moonyuet
moonyuet requested a review from BigRoy August 11, 2026 04:52

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

Settings conversion now works, nice! :)

I do have some remaining mostly cosmetic notes.

Comment thread server/settings/conversion.py Outdated
Comment thread server/settings/conversion.py Outdated
Comment thread server/settings/conversion.py
moonyuet and others added 2 commits August 11, 2026 18:57
Co-authored-by: Roy Nieterau <roy_nieterau@hotmail.com>
Comment thread server/settings/conversion.py Outdated
@moonyuet
moonyuet requested a review from BigRoy August 11, 2026 13:04
Comment thread server/settings/conversion.py Outdated
Comment thread server/settings/publish_plugins.py
Comment thread client/ayon_nuke/api/plugin.py Outdated
Comment thread client/ayon_nuke/api/plugin.py Outdated
@moonyuet
moonyuet force-pushed the enhancement/YN-0771-intermediate-presets-with-more-robust-config branch from 7e7f7d1 to 174f0b3 Compare August 12, 2026 13:20
…1-intermediate-presets-with-more-robust-config
@moonyuet
moonyuet requested a review from rdelillo August 12, 2026 13:21

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

Works as expected, tested with multiple review intermediate and did not fail on non-existing knobs 🥳 .

Image

There is the default on new settings and single-frame review intermediate bugs but they should be handled via other PRs.

@BigRoy
BigRoy merged commit 0d71c40 into develop Aug 12, 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.

YN-0771: Intermediate presets with more robust config

6 participants