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

[MAYA-114247] Selection Highlight doesn't update when changing selection with USD 21.11 #1752

Closed
dj-mcg opened this issue Oct 12, 2021 · 8 comments · Fixed by #1838
Closed
Labels
bug Something isn't working vp2renderdelegate Related to VP2RenderDelegate

Comments

@dj-mcg
Copy link
Collaborator

dj-mcg commented Oct 12, 2021

Describe the bug
If building against the USD dev branch (which will become 21.11 shortly), selection highlighting does not update when selection changes. As soon as you poke metadata on the item in the AE (instanceable, kind, etc), selection highlight will update correctly.

Steps to reproduce
Steps to reproduce the behavior:

  1. Create a new USD Scene
  2. Verify your USD Selection Mode is set appropriately to select individual prims
  3. Add a USD cube and a USD sphere
  4. Translate them so they are in different positions
  5. Change selection from cube to sphere and back again in either the Outliner or the Viewport
  6. Observe that selection highlight does not update
  7. Poke the Instanceable metadata checkbox for the selected prim in the AE
  8. Observe selection highlight updates correctly
  9. Try changing selection again
  10. Observe the broken behavior

Expected behavior
Selection highlight appropriately updates when selection changes.

Specs (if applicable):

  • Linux 64 bit
  • Maya 2022.2
  • Maya USD: dev at 4710d36
  • Pixar USD: dev at 96c5a3f

Additional context
It appears the VP2 Render Delegate is expecting Hydra to resync upon selection change, since the actual highlight logic appears to be within some hydra sync callbacks. There has been recent changes to the Hydra resync logic, and with the latest version, Hydra doesn't think there is any reason to resync upon selection change. Changing metadata WILL force hydra to sync, which calls into the callback and updates selection highlight properly.

We may want to manage the selection logic ourselves so we aren't depending on syncing, similar to USDView - see examples here:

Selection Update Calls: pxr/usdImaging/usdviewq/stageView.py
Selection Management and Rendering: pxr/usdImaging/usdImagingGL/engine.cpp
Selection Tracking: pxr/imaging/hdx/selectionTracker.cpp

@dj-mcg dj-mcg added the bug Something isn't working label Oct 12, 2021
@dj-mcg
Copy link
Collaborator Author

dj-mcg commented Oct 12, 2021

shapes.tar.gz

@santosd santosd assigned santosd and unassigned santosg87 Oct 12, 2021
@santosd santosd changed the title Selection Highlight doesn't update when changing selection with USD 21.11 [MAYA-114247] Selection Highlight doesn't update when changing selection with USD 21.11 Oct 12, 2021
@santosd santosd removed their assignment Oct 12, 2021
@dj-mcg
Copy link
Collaborator Author

dj-mcg commented Oct 21, 2021

Just for tracking purposes, this is internal Pixar Jira MAYA-3120

@williamkrick
Copy link
Contributor

@dj-mcg I've created a pull request to fix selection for vp2RenderDelegate. I had to take a different approach than Hydra Storm does. We don't really have a simple way to integrate that selection tracker idea into our draw pipeline. Instead I've tried to restore the old behavior of Sync-ing rprims which have selection changed. I do this by directly setting a dirty bit on selected/deselected prims, and then having the rest of the code work the same way.

Please let me know if this works for you.

@dj-mcg
Copy link
Collaborator Author

dj-mcg commented Nov 17, 2021

Thanks @williamkrick - I'll sync to your branch today and let you know

@gracekumagai
Copy link

Hey @williamkrick - thanks for the fix!

I'm testing with the branch that @dj-mcg built and so far, with "Smooth Shade All" shading, it seems to be working as expected.

However, when flipping to "Wireframe" or "Wireframe on shaded", the selection higlight starts sticking and drawing incorrectly again.

For example, the selection highlight will remain in the previous location:

  1. Open a new file in Maya 2022
  2. Navigate to Create -> Universal Scene Description (USD) -> Stage with new layer
  3. Right click on the proxy shape -> Add new prim -> Capsule
  4. Right click on the proxy shape -> Add new prim -> Cube
  5. Toggle the shading from "Smooth Shade All" to "Wireframe" and back to "Smooth Shade All" (I can sometimes reproduce this error without this step).
  6. Move the cube
  7. Toggle the shading back to "Wireframe"

You will notice that the wireframe draws around the original position of the cube and not at it's new position. It will update if you move the cube in the particular mode. The same drawing issue occurs when moving the cube in "Wireframe" and toggling back to "Smooth Shade All."
selectionHighlight_smoothToWire

For example, the selection highlight will not update as you change selection:

  1. Open a new file in Maya 2022
  2. Navigate to Create -> Universal Scene Description (USD) -> Stage with new layer
  3. Right click on the proxy shape -> Add new prim -> Capsule
  4. Right click on the proxy shape -> Add new prim -> Cube
  5. Toggle the shading from "Smooth Shade All" to "Wireframe" (or "Wireframe on shaded")
  6. Move the cube
  7. Unselect the cube

You will notice that even though the cube is not selected, the wireframe is green. If you select the capsule, it will not update the wireframes. If you move the capsule, it will highlight, however, the cube's wireframe remains green. There are a few more observations in the gif:
selectionHighlight_stuckWireframe

Let me know if you think this is a separate issue and I can file a separate ticket! Thank you so much!

@williamkrick
Copy link
Contributor

@gracekumagai I will try to reproduce this and either re-open this one or log a new one on Thursday.

@williamkrick
Copy link
Contributor

Re-opening while I work on a fix for the issues with wireframe and wireframe on shaded.

@williamkrick williamkrick reopened this Nov 25, 2021
@wtelford wtelford added mtoh Related to legacy Maya to Hydra plugin. vp2renderdelegate Related to VP2RenderDelegate and removed mtoh Related to legacy Maya to Hydra plugin. labels Nov 29, 2021
@williamkrick
Copy link
Contributor

@gracekumagai I believe this is working correctly now, please let us know if you find more issues!

@neilh-adsk neilh-adsk moved this to Done in maya-usd Nov 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working vp2renderdelegate Related to VP2RenderDelegate
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

6 participants