Skip to content

Fix issue with color space name sanitization - #3141

Merged
jstone-lucasfilm merged 1 commit into
AcademySoftwareFoundation:mainfrom
autodesk-forks:walker_sanitize-name-fix
Nov 28, 2026
Merged

jstone-lucasfilm merged 1 commit into
AcademySoftwareFoundation:mainfrom
autodesk-forks:walker_sanitize-name-fix

Conversation

@doug-walker

@doug-walker doug-walker commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

While testing the 1.39.6 release candidate, my colleagues Jannik Frohne and Sathya Rajan discovered an issue that impacts the OcioColorManagementSystem when the color space name ends in a character that must be sanitized because it would not be legal in a shader function name. This results in GenShader producing a shader that does not compile because the color space conversion function name does not match what is used at the call site. This causes the material to not render.

This PR makes the following changes:

  • Fixes the name sanitization problem in OcioColorManagementSystem.cpp.
  • Updates the ocio_color_management.mtlx file to use "sRGB Encoded Rec.709 (sRGB)", which is a synonym for "Utility - sRGB - Texture", but where the last character needs to be sanitized. This fails to render without the fix.
  • Adds a new test case to GenShader.cpp that catches the issue of illegal characters at the beginning or end of the name as well as the issue of names containing a colon, which MaterialX's createValidName function does not replace.
  • Updates minimal_config.ocio to add some color space names (as aliases) to test the sanitization. Used in the GenShader.cpp test.

All tests pass with MATERIALX_BUILD_OCIO=ON and OFF.

The bug was introduced in PR #2954, which was merged after the 1.39.5 release. Ideally, this fix will be merged prior to the 1.39.6 release to avoid introducing a regression.

Assisted-by: Claude Code / Sonnet 5.5

Signed-off-by: Doug Walker <doug.walker@autodesk.com>

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

Thanks to @doug-walker and the Autodesk team for this fix. Given the simplicity and limited scope of the change, and with the additional context that it addresses a regression within MaterialX v1.39.6 itself, this seems safe and worthwhile to include to v1.39.6.

@jstone-lucasfilm
jstone-lucasfilm merged commit 8e36e88 into AcademySoftwareFoundation:main Nov 28, 2026
41 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants