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

Select prim without data source must not crash. #194

Merged
merged 1 commit into from
Oct 28, 2024

Conversation

ppt-adsk
Copy link
Collaborator

No description provided.

@ppt-adsk ppt-adsk requested a review from debloip-adsk October 28, 2024 15:33
@ppt-adsk ppt-adsk self-assigned this Oct 28, 2024
@@ -76,7 +76,7 @@ class _PrimSource : public HdContainerDataSource

TfTokenVector GetNames() override
{
TfTokenVector names = _inputSource->GetNames();
TfTokenVector names = _inputSource ? _inputSource->GetNames() : TfTokenVector();
Copy link
Collaborator Author

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)) {
Copy link
Collaborator Author

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.

Copy link
Collaborator Author

@ppt-adsk ppt-adsk Oct 28, 2024

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.

Copy link
Collaborator Author

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@
Copy link
Collaborator Author

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"
Copy link
Collaborator Author

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.

@ppt-adsk ppt-adsk assigned ppt-adsk and unassigned ppt-adsk Oct 28, 2024
@ppt-adsk ppt-adsk added the ready-for-merge Development process is finished, PR is ready for merge label Oct 28, 2024
@lilike-adsk lilike-adsk merged commit d8c2707 into dev Oct 28, 2024
10 of 11 checks passed
@lilike-adsk lilike-adsk deleted the tremblp/HYDRA-1171/no_crash_on_cards branch October 28, 2024 19:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-merge Development process is finished, PR is ready for merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants