-
Notifications
You must be signed in to change notification settings - Fork 201
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
MAYA-108563 - Support default material shading using new SDK APIs #1339
MAYA-108563 - Support default material shading using new SDK APIs #1339
Conversation
Draws correctly, but selection fails to update in default material repr.
Incomplete. One item remaining: selection does not update when dealing with the default material repr. |
@@ -1597,7 +1642,8 @@ void HdVP2Mesh::_UpdateDrawItem( | |||
} | |||
#endif | |||
|
|||
if (desc.geomStyle == HdMeshGeomStyleHull) { | |||
if (desc.geomStyle == HdMeshGeomStyleHull | |||
&& desc.shadingTerminal == HdMeshReprDescTokens->surfaceShader) { |
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.
defaultMaterial repr has a different shading terminal and will skip the shading update.
Regular smoothMesh has "surfaceShader" as terminal, so this addition does not require version check.
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 modify the real material while in default material mode does it update correctly when we turn off "use default material"? IIRC somewhere we clear all the dirty flags, so we'd forget about the dirty material id and then not update.
Done and working, but can not be run thru preflight until some Maya updates are integrated. |
…l_shading_mode # Conflicts: # lib/mayaUsd/render/vp2RenderDelegate/mesh.cpp
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.
I put request changes until we clarify the question about material updates while in "use default material" mode.
if (reprToken == HdReprTokens->smoothHull | ||
|| reprToken == HdVP2ReprTokens->defaultMaterial) { | ||
// Share selection highlight render item between smoothHull and defaultMaterial: | ||
bool foundShared = false; |
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 end up using this pattern to share more render items then this seems like a good candidate to be refactored into a method.
@@ -1597,7 +1642,8 @@ void HdVP2Mesh::_UpdateDrawItem( | |||
} | |||
#endif | |||
|
|||
if (desc.geomStyle == HdMeshGeomStyleHull) { | |||
if (desc.geomStyle == HdMeshGeomStyleHull | |||
&& desc.shadingTerminal == HdMeshReprDescTokens->surfaceShader) { |
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 modify the real material while in default material mode does it update correctly when we turn off "use default material"? IIRC somewhere we clear all the dirty flags, so we'd forget about the dirty material id and then not update.
In #1339 code was added to share the selection render item between reprs. The code did not track usage, so as soon as one of the reprs is removed, the render item was removed from the subscene as well, leaving dangling pointers in the remaining reprs. In #1597 code was added that seem to indicate there was suspicion about render item issues, but sharing was not identified as the cause. This PR adds use count tracking to the render item so they only get removed from the subscene once all reprs have stopped using the shared render item.
Draws correctly, but selection fails to update in default material repr.