-
Notifications
You must be signed in to change notification settings - Fork 4
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
Select prim without data source must not crash. #194
Conversation
@@ -76,7 +76,7 @@ class _PrimSource : public HdContainerDataSource | |||
|
|||
TfTokenVector GetNames() override | |||
{ | |||
TfTokenVector names = _inputSource->GetNames(); | |||
TfTokenVector names = _inputSource ? _inputSource->GetNames() : TfTokenVector(); |
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.
Allow input data source to be null.
// https://forum.aousd.org/t/representation-of-invalid-hdsceneindexprim/833/2 | ||
// ). Such an ancestor prim can be selected, even if typeless, so add | ||
// a selection data source in such a case. | ||
if (!result.dataSource && !_selection->IsFullySelected(primPath)) { |
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.
The bug fix. The crash was caused by a failing assertion in the wireframe selection highlighting scene index, triggered by the fact that switching selection to a prim without a data source did not add a selection data source to that 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.
Without the fix, this test crashes. With the fix, it passes.
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.
Trivial model with cards draw mode support. This creates a parent without a data source, which is how the crash gets triggered.
) | ||
{ | ||
uniform bool model:applyDrawMode = 1 | ||
asset model:cardTextureXNeg = @./red20x20.png@ |
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.
All card axes have the same texture in our test, which is unimportant. A real model would have different textures.
kind = "group" | ||
) | ||
{ | ||
uniform token model:drawMode = "cards" |
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.
This causes refAssetB to be drawn in card mode, which triggers the bug.
No description provided.