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

Improve connecting to surface experience #2534

Merged
merged 2 commits into from
Aug 22, 2022

Conversation

JGamache-autodesk
Copy link
Collaborator

  • If we can not find a shader source type, assume the user knows what he
    is doing.
  • If trying to connect a node graph output to surface, dig into the node
    graph in case we find a shader source type by traversing the
    connections.

- If we can not find a shader source type, assume the user knows what he
  is doing.
- If trying to connect a node graph output to surface, dig into the node
  graph in case we find a shader source type by traversing the
  connections.
PXR_NS::SdrShaderNodeConstPtr
_GetShaderNodeDef(const PXR_NS::UsdPrim& prim, const PXR_NS::TfToken& attrName)
{
UsdPrim targetPrim = prim;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Traverse into layers of NodeGraphs until a shader is found. Similar to what we do when traversing node graphs in the material importer.

TfToken renderContext = srcShaderNodeDef->GetSourceType() == "glslfx"
= _GetShaderNodeDef(srcUsdAttr->usdPrim(), srcBaseName);
TfToken renderContext
= !srcShaderNodeDef || srcShaderNodeDef->GetSourceType() == "glslfx"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

If we do not find a shader node def, assume the user knows what he is doing and that connecting on the regular surface port is what he wants.

@JGamache-autodesk JGamache-autodesk added the ready-for-merge Development process is finished, PR is ready for merge label Aug 8, 2022
@seando-adsk seando-adsk added ufe-usd Related to UFE-USD plugin in Maya-Usd materials labels Aug 22, 2022
@seando-adsk seando-adsk merged commit b370229 into dev Aug 22, 2022
@seando-adsk seando-adsk deleted the t_gamaj/fix_issues_with_shader_discovery branch August 22, 2022 19:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
materials ready-for-merge Development process is finished, PR is ready for merge ufe-usd Related to UFE-USD plugin in Maya-Usd
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants