-
Notifications
You must be signed in to change notification settings - Fork 203
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
Conversation
- 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; |
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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.
is doing.
graph in case we find a shader source type by traversing the
connections.