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

vp2RenderDelegate can highlight wrong point instances selection after instancer changes. #3407

Closed
jufrantz opened this issue Oct 23, 2023 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@jufrantz
Copy link
Contributor

Describe the bug

Viewport selection highlighting can get wrong after changing some instancer attributes like invisibleIds and protoIndices.

Steps to reproduce

  1. Create a mayaUsd proxyShape with an usd point instancer.
import pxr.UsdGeom
import maya.cmds
import mayaUsd.ufe
import mayaUsd_createStageWithNewLayer

maya.cmds.loadPlugin("mayaUsdPlugin", quiet=True)

proxyShape = mayaUsd_createStageWithNewLayer.createStageWithNewLayer()
shapeStage = mayaUsd.ufe.getStage(proxyShape)

shapeStage.GetRootLayer().ImportFromString('''#sdf 1
(
    defaultPrim="PI"
)
def PointInstancer "PI"
{
    point3f[] positions = [(0, 0, 0), (2, 0, 2), (2, 0, -2), (-2, 0, -2), (-2, 0, 2)]
    int[] protoIndices = [0, 0, 1, 1, 1]
    rel prototypes = [</PI/Protos/Sphere>, </PI/Protos/Cube>]

    def Scope "Protos"
    {
        def Sphere "Sphere" {}
        def Cube "Cube" {}
    }
}
''')
  1. Select point instances at usd indices 2 and 3.
instancer = pxr.UsdGeom.PointInstancer(shapeStage.GetDefaultPrim())
instanceIndices = [2, 3]
maya.cmds.select([f"{proxyShape},{instancer.GetPath()}/{idx}" for idx in instanceIndices])
# Ensure viewport selection hiliting is updated
maya.cmds.refresh()
  1. Make instances invisible by setting invisibleIds attribute
instancer.GetInvisibleIdsAttr().Set(instanceIndices)
  1. Notice that instance 4 is now wrongly highlighted.

  2. Rebuild the scene by redoing steps 1) and 2).

  3. Change per-instance prototypes by setting protoIndices attribute

instancer.GetProtoIndicesAttr().Set([1, 1, 0, 0, 0])
  1. Notice that instances 0 and 1 are now wrongly highlighted.

Expected behavior

We expect viewport to highlight the point instances of ufe global selection even after instancing editions.

Specs (if applicable):

  • CentOS 7.8
  • Maya 2023.3
  • maya-usd 0.25
  • USD 22.11
@jufrantz jufrantz added the bug Something isn't working label Oct 23, 2023
@neilh-adsk neilh-adsk moved this to Needs triage in maya-usd Nov 6, 2023
@github-project-automation github-project-automation bot moved this to Needs triage in Issue Triage Aug 28, 2024
@jufrantz
Copy link
Contributor Author

I retested with v0.30.0, and this appears to be resolved, very likely due to #3744 .
Thank you! Closing the issue now.

@github-project-automation github-project-automation bot moved this from Needs triage to Done in Issue Triage Oct 31, 2024
@github-project-automation github-project-automation bot moved this from Needs triage to Done in maya-usd Oct 31, 2024
@Autodesk Autodesk deleted a comment from maya-usd-git-sync bot Oct 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Status: Done
Development

No branches or pull requests

2 participants