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

Fix swizzle edge cases in version upgrade #1957

Merged

Conversation

nadult
Copy link
Contributor

@nadult nadult commented Aug 1, 2024

This PR fixes 2 edge cases when upgrading materials from version 1.38 to 1.39 involving swizzle nodes:

  • swizzle xyz -> xyz, rgb -> rgb wasn't handled properly, because convert nodedefs were missing for such cases
  • swizzle xy -> xxx is incorrectly changed to convert node

Tests are also added to cover these cases.

Copy link

linux-foundation-easycla bot commented Aug 1, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

Signed-off-by: Jonathan Stone <[email protected]>
@nadult
Copy link
Contributor Author

nadult commented Aug 2, 2024

@jstone-lucasfilm sorry for the formatting errors. I actually thought that the code was properly formatted, because I'm using an automatic formatting plugin in Visual Studio based on clang-format. But it turns out, that I'm using a newer version (16) than the version which is used in MaterialX (13 I guess?). Unfortunately even with the same .clang-format configuration file, there are slight differences in formatting between different versions...

In this case, I think it's fine to omit the new unit test for these specific swizzle patterns, following the approach we use for validating earlier version upgrades.

If there are production examples of materials leveraging these swizzle patterns, it would be fine to include them in our test suite with other version upgrade examples:

https://github.com/AcademySoftwareFoundation/MaterialX/tree/main/resources/Materials/TestSuite/stdlib/upgrade

Signed-off-by: Jonathan Stone <[email protected]>
Signed-off-by: Jonathan Stone <[email protected]>
Signed-off-by: Jonathan Stone <[email protected]>
Copy link
Member

@jstone-lucasfilm jstone-lucasfilm left a comment

Choose a reason for hiding this comment

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

Thanks for this fix, @nadult!

@jstone-lucasfilm jstone-lucasfilm changed the title Fix edge cases in version upgrade (swizzles) Fix swizzle edge cases in version upgrade Aug 8, 2024
@jstone-lucasfilm jstone-lucasfilm merged commit 3ec6e87 into AcademySoftwareFoundation:main Aug 8, 2024
34 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