Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AY-7442 Dissociate file_type and ext knob computation (SXR and JPG extension support). #81

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

robin-ynput
Copy link
Contributor

@robin-ynput robin-ynput commented Feb 26, 2025

Changelog Description

resolve: #69
resolve: #72

Changes to ensure SXR (exr) and JPG (jpeg) can be rendered out of our Render write nodes through AYON settings.

Needs to be tested with ynput/ayon-core#1165 to ensure loader is OK.

Additional review information

Current implementation in Nuke assumes that file_type and output file extension are always matching.
However Nuke has some disperencies here:

  • file extension: jpg / file_type: jpeg
  • file extension: sxr / file_type: exr

These changes ensure extension is set from an ext knob if defined, then computed from the path knob.

Testing notes:

Render SXR output:

  1. Set Render (write) node knobs settings (ayon+settings://nuke/imageio/nodes/required_nodes/0/knobs) to:
    • file_type : exr (Text)
    • ext: sxr (Text)

Render JPG output:

  1. Set Render (write) node knobs settings (ayon+settings://nuke/imageio/nodes/required_nodes/0/knobs) to:

    • file_type : jpeg (Text)
    • ext: jpg (Text)
  2. Create a new Render product

  3. Publisher the Render product

  4. Ensure the sxr or jpg representation if properly published

@robin-ynput robin-ynput self-assigned this Feb 26, 2025
@robin-ynput robin-ynput added type: enhancement Improvement of existing functionality or minor addition sponsored This is directly sponsored by a client or community member labels Feb 26, 2025
@robin-ynput robin-ynput changed the title AY-7442 Dissociate file_type and ext knob computation (SXR support). AY-7442 Dissociate file_type and ext knob computation (SXR and JPG extension support). Feb 26, 2025
# Determine defined file type
path = node["file"].value()
_, ext = os.path.splitext(path)
_, ext = ext.split(".", 1)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This would mean the file extension drives the representation name and not the file_type anymore, is that OK ?
This means those would be different jpg vs jpeg and exr vs sxr

Copy link
Member

Choose a reason for hiding this comment

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

Would be question for @jakubjezek001 .

Copy link
Member

Choose a reason for hiding this comment

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

yes, and the solution is great! We will need to also add this into documentation please. Ideally around this section please https://ayon.ynput.io/docs/addon_nuke_admin#creator-plugins

ext = write_node["file_type"].value()
path = write_node["file"].value()
_, ext = os.path.splitext(path)
_, ext = ext.split(".", 1)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
_, ext = ext.split(".", 1)
ext = ext.lstrip(".")

Comment on lines +167 to +168
_, ext = os.path.splitext(path)
_, ext = ext.split(".", 1)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
_, ext = os.path.splitext(path)
_, ext = ext.split(".", 1)
ext = os.path.splitext(path)[1].lstrip(".")

nuke.message(
"ERROR: No file type found in the subset's knobs."
"ERROR: No 'file_type' nor 'ext' found in the subset's knobs."
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this subset be refactored to product now too? While we're at it.

Suggested change
"ERROR: No 'file_type' nor 'ext' found in the subset's knobs."
"ERROR: No 'file_type' nor 'ext' found in the product's knobs."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sponsored This is directly sponsored by a client or community member type: enhancement Improvement of existing functionality or minor addition
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AY-7456_jpg loader and representation name jpeg AY-7442_SXR - OpenStereoEXR file format support
4 participants