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

HdSceneIndexAdapterSceneDelegate::GetMaterialResource() returns wrong network in certain situations #3286

Open
robp-sidefx opened this issue Sep 10, 2024 · 1 comment

Comments

@robp-sidefx
Copy link

robp-sidefx commented Sep 10, 2024

The specific alignment of the stars is as follows:

  • MyRenderDelegate::GetMaterialRenderContexts() returns ["foo", "bar"]
  • USD Material has outputs:bar:surface and outputs:surface

The issue:

I would expect that HdSceneIndexAdapterSceneDelegate::GetMaterialResource() would return the "bar" network but, instead, it returns the "" network.

The cause (as best I can tell):

When we call GetMaterialResource(), it iterates through our delegate's list of supported contexts, starting with "foo", and calls HdMaterialSchema::GetMaterialNetwork("foo"). This context doesn't exist in the USD file, so GetMaterialNetwork() instead attempts to return a network for the "" context which, in this case, does exits. GetMaterialResource() recognises that a valid network has been returned and immediately sends it back to us.

@jesschimein
Copy link
Contributor

Filed as internal issue #USD-10102

robp-sidefx added a commit to sideeffects/USD that referenced this issue Oct 2, 2024
…rom the scene delegate to the material schema. This ensures that the fallback context is only used if *all* the delegate's contexts fail.

Related to PixarAnimationStudios#3286
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

No branches or pull requests

2 participants