Adsk Contrib - Write no-clamp Range for SMPTE CLF Broadcast Profile - #2349
Merged
doug-walker merged 2 commits intoSep 29, 2026
Merged
doug-walker merged 2 commits into
doug-walker merged 2 commits into
Conversation
Signed-off-by: Doug Walker <doug.walker@autodesk.com>
zachlewis
approved these changes
Sep 28, 2026
cozdas
approved these changes
Sep 29, 2026
cozdas
left a comment
Collaborator
There was a problem hiding this comment.
I could not find any issues, looks good to me.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As pointed out by Nick Shaw, OCIO is currently unable to write SMPTE ST2136-10 Broadcast Profile CLF files because of how OCIO handles the "noClamp" style attribute of a CLF Range process node. (These process nodes do a full-to-narrow conversion on input and a narrow-to-full conversion on output, allowing the CLFs to be universal files that may provide any combination of input or output range scaling.)
When reading a CLF, these are (exactly) converted to a Matrix. This allows an important simplification to the OCIO optimization process since in OCIO a Range always clamps and a Matrix does not. However, it poses a problem since there is currently no way to write the noClamp Range called for by ST2136-10. Writing these as a Matrix (which includes an offset) would be mathematically equivalent but would not be compliant with the spec.
I considered various possibilities for how to address this. I definitely don't want to allow the existence of non-clamping Ranges, since this would add a lot of internal complexity to OCIO. But there are other options, for example, I considered handling Broadcast Profile as a separate flavor of CLF (i.e. adding a new file format option to GroupTransform::write). But that only seemed the correct approach if OCIO is doing more stuff, for example, populating expected values of the CLF Info element. But there are some things there that only the person creating the file would know and I didn't want to make all that stuff arguments to the writer.
Ultimately, I decided to take the most minimalist approach. When the format argument to GroupTransform::write is "Academy/ASC Common LUT Format", this PR checks the first and last Transforms to see if they are a MatrixTransform that is equivalent to the specific noClamp Ranges expected by ST2136-10 and, if so, writes them as Ranges.
A test is provided to validate that an ST2136-10 file may now be written successfully.
Note regarding CLF version: Since PR #2265, CLF writing always hardcodes writeVersion = CTF_PROCESS_LIST_VERSION_2_0 (CTFTransform.cpp in TransformWriter::write), which is above the 1.7 version that introduced style="noClamp". So any CLF we write can safely carry style="noClamp" on a Range.
Assisted by: Claude Code / Sonnet 5