-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[al] Invalid Prims Validation in UsdImagingMaterialAdapter::GetMaterialResource() #2930
[al] Invalid Prims Validation in UsdImagingMaterialAdapter::GetMaterialResource() #2930
Conversation
Filed as internal issue #USD-9240 |
Hi @NickWu. Good find! Our theory is that if |
No worries! |
Hey Nick, In our current usage of this function, I'd consider it an error for this function to be passed a null prim. If I replace the early out with an error and an early out, you'd get an error message but no crash. Would that solve your issue? Thanks! |
Hey @tcauchois , I'll give it a try and get back to you. Thank you for the suggestion. |
Hi @tcauchois , I tested it and it worked fine to me. I have updated the code based on your suggestion. |
Hey @tcauchois , I think I might have misunderstood what you meant. I think you meant we only issue an error and early out in the case of a null prim and keep the if (!prim) {
TF_RUNTIME_ERROR("Received prim is null.");
return VtValue();
}
if (!_GetSceneMaterialsEnabled()) {
return VtValue();
} |
/AzurePipelines run |
Azure Pipelines successfully started running 1 pipeline(s). |
Yeah exactly, the code in your comment was what I had in mind. But if the current PR works for you, the code in your comment should as well. Thanks! |
Hi Nick, could you update your PR with the code proposed above? Thanks! |
Sure thing. I'll update it. Thanks! |
Hi @tcauchois , I have updated the code. |
/AzurePipelines run |
Azure Pipelines successfully started running 1 pipeline(s). |
Description of Change(s)
We came crossed this issue in our pipeline where there is a possibility that the
UsdPrim
passed in toUsdImagingMaterialAdapter::GetMaterialResource()
could be invalid so we'd like to propose a prim validation check here.Fixes Issue(s)
crashes in maya when displaying textures in the viewport.
I have verified that all unit tests pass with the proposed changes