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

USDShader : Fix loading of terminals with USD 24.08 #6017

Merged
merged 1 commit into from
Aug 28, 2024

Conversation

johnhaddon
Copy link
Member

At some point - and for reasons unknown - terminals started confidently declaring themselves as a cleanly mapped Token type in SdrShaderProperty.GetTypeAsSdfType(). This caused us to load them as StringPlugs, which certainly doesn't match the intent behind terminals. We now check the SdrShaderProperty.GetType() explicitly to detect terminals and vstructs so we can continue to load them as bare Plugs. This seems cleaner than the original approach, and lets us simplify loadParameter() such that it just needs to accept an SdfValueTypeName rather than the more convoluted NdrSdfTypeIndicator that has no relevance when loading from schemas rather than the shader registry.

This should let us drop the last commit from #6016 and merge it.

At some point - and for reasons unknown - terminals started confidently declaring themselves as a cleanly mapped Token type in `SdrShaderProperty.GetTypeAsSdfType()`. This caused us to load them as StringPlugs, which certainly doesn't match the intent behind terminals. We now check the `SdrShaderProperty.GetType()` explicitly to detect terminals and vstructs so we can continue to load them as bare Plugs. This seems cleaner than the original approach, and lets us simplify `loadParameter()` such that it just needs to accept an `SdfValueTypeName` rather than the more convoluted `NdrSdfTypeIndicator` that has no relevance when loading from schemas rather than the shader registry.
@johnhaddon johnhaddon self-assigned this Aug 28, 2024
Copy link
Contributor

@murraystevenson murraystevenson left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks!

@murraystevenson murraystevenson merged commit ab683e9 into GafferHQ:main Aug 28, 2024
6 checks passed
@johnhaddon johnhaddon deleted the usdShaderFix branch October 1, 2024 09:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Pending release
Development

Successfully merging this pull request may close these issues.

2 participants