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

usdview picks prototype meshes instead of top-level instancers in v20.05 #1196

Closed
asluk opened this issue May 6, 2020 · 6 comments
Closed

Comments

@asluk
Copy link
Collaborator

asluk commented May 6, 2020

With the rewrite of instance index to prim path queries in 82e343c , it looks like picking point instancers in instance or prim picking mode ends up selecting the prototype meshes instead of the overarching point instancer prim. For example, this is the output from the ptinst city with USDIMAGING_SELECTION debug enabled:

GetScenePrimPath: proto = /MediterraneanHills/Buildings.proto1_mesh_0_id0
GetScenePrimPath(/MediterraneanHills/Buildings.proto1_mesh_0_id0, 1840) = /MediterraneanHills/Buildings/Prototypes/prototype_1/mesh_0
Prim selection: /MediterraneanHills/Buildings/Prototypes/prototype_1/mesh_0
- affected hydra prim: /MediterraneanHills/Buildings.proto1_mesh_0_id0
PopulateSelection: proto = /MediterraneanHills/Buildings.proto1_mesh_0_id0 pi = /MediterraneanHills/Buildings
PopulateSelection: (prim) /MediterraneanHills/Buildings.proto1_mesh_0_id0 []

It looks like it does know that that "pi" is /MediterraneanHills/Buildings, but the actual returned path and selection content is the prototype mesh. In prim picking mode, all instances for the selected prototype get highlighted in the viewport.

This breaks workflows where a user wants to pick a point instancer in the viewport and toggle vis/invis, for example, at the prim level.

Ideally, usdview would pick the top-level instancer in this case, and UsdImaging would expose an API which, given an rprim and instance index, return the path to that top-level instancer.

Thank you!

@asluk
Copy link
Collaborator Author

asluk commented May 6, 2020

@jtran56
Copy link

jtran56 commented May 12, 2020

Filed as internal issue #USD-6054.

pixar-oss pushed a commit that referenced this issue Jun 30, 2020
…of selecting the root boundable of the picked object. Add "Pick prototypes", with the current behavior of selecting an instance of the picked gprim.

This necessitates passing HdInstancerContext into python.  The instancer munging code in the selection model and the rollover handling has also been updated for the new API.

Fixes #1196

(Internal change: 2078845)
@asluk
Copy link
Collaborator Author

asluk commented Jul 14, 2020

I've verified that I can pick the top-level instancer in the City_set again with v20.08-rc1 usdview -- thanks!

However, I can't pick the top-level instances in this "point instancers inside native instances" example -
ni_pi.zip , whereas I can in v19.11 usdview.

pixar-oss pushed a commit that referenced this issue Jul 16, 2020
… native instances, if applicable.

Fixes #1196

(Internal change: 2083804)
@asluk
Copy link
Collaborator Author

asluk commented Jul 17, 2020

Thanks for the fix-- I implemented something similar to get this working in our app as well.

It feels like something is going awry with the intersection test itself though-- most of the time, picking on geometry in the previously attached native/ptinst nesting doesn't get a hit. Here is some usdviewq.StageView.pick() debug output from picking around the same area several times in v20.08-rc3 until it hits, where as in v19.11, it would always get a hit.

Pick results = (Gf.Vec3d(6.95232936630046e-310, 0.0, 0.0), Sdf.Path.emptyPath, 89096624, Sdf.Path.emptyPath, -1)

Pick results = (Gf.Vec3d(6.95232936630046e-310, 0.0, 0.0), Sdf.Path.emptyPath, 89096624, Sdf.Path.emptyPath, -1)

Pick results = (Gf.Vec3d(6.95232936630046e-310, 0.0, 0.0), Sdf.Path.emptyPath, 89096624, Sdf.Path.emptyPath, -1)

Pick results = (Gf.Vec3d(6.95232936630046e-310, 0.0, 0.0), Sdf.Path.emptyPath, 89096624, Sdf.Path.emptyPath, -1)

Pick results = (Gf.Vec3d(6.95232936630046e-310, 0.0, 0.0), Sdf.Path.emptyPath, 89096624, Sdf.Path.emptyPath, -1)

Pick results = (Gf.Vec3d(6.95232936630046e-310, 0.0, 0.0), Sdf.Path.emptyPath, 89096624, Sdf.Path.emptyPath, -1)

Pick results = (Gf.Vec3d(6.95232936630046e-310, 0.0, 0.0), Sdf.Path.emptyPath, 89096624, Sdf.Path.emptyPath, -1)

Pick results = (Gf.Vec3d(6.95232936630046e-310, 0.0, 0.0), Sdf.Path.emptyPath, 89096624, Sdf.Path.emptyPath, -1)

Pick results = (Gf.Vec3d(95.10247802734375, 401.83282470703125, 19.532217025756836), Sdf.Path('/World/sphereInstancer/Instancer/Dummy/sphere'), 10, Sdf.Path('/World/sphereInstancer/Instancer'), 10)

@asluk
Copy link
Collaborator Author

asluk commented Jul 17, 2020

I don't necessarily think that the remaining pick-miss issue needs to hold up the release from our perspective, as it works properly in our app, but I'm not sure what's going awry in usdview, at least on Windows.

@spiffmon
Copy link
Member

spiffmon commented Jul 17, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants