You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A call to UsdImagingDelegate::PopulateSelection for a USDXform prim which is a parent to an instancer with N instances (that uses UsdImagingInstanceAdapter) will create an HdSelection which contains N^2 instances.
Steps to Reproduce
Create a scene with a USDXform that is a parent to an instancer. The instancer should have N instances. In my case it has 11.
Using for favorite USD app, call UsdImagingDelegate::PopulateSelection() on the USDXform that is the parent (or higher ancestor) or the instancer. The instanceIndex parameter should be UsdImagingDelegate::ALL_INSTANCES.
Examine the resulting HdSelection for the instancer. Inside instanceIndices I find N^2 indices (121 rather than 11).
What seems to be happening is the call to _GatherDependencies in PopulateSelection finds a path to all N instances. Then each call to PopulateSelection is on an UsdImagingInstanceAdapter. That gets the UsdImagingDelegate::ALL_INSTANCES parameter and adds N instances. The adding N instances happens N times, so N^2 instanceIndices.
I would expect instanceIndices to contain each index only once. I would also expect the HdSelectionState to have fullySelected=true, but I don't get that either.
Maybe we are making the call to PopulateSelection incorrectly? Or maybe I am interpreting the instanceIndices buffer incorrectly? Any additional information would be helpful.
System Information (OS, Hardware)
Windows
Package Versions
USD v20.05, MayaUSD dev branch at 2164db46
Build Flags
The text was updated successfully, but these errors were encountered:
…imationStudios#1240)
- Fix resource binding issue when multiple batches are executed but
one of them doesn't draw or submit work. The next batch will set
a new pipeline while still having the old resources bound incorrectly.
Description of Issue
A call to
UsdImagingDelegate::PopulateSelection
for a USDXform prim which is a parent to an instancer with N instances (that uses UsdImagingInstanceAdapter) will create an HdSelection which contains N^2 instances.Steps to Reproduce
I noticed this when working on MayaUSD issue Autodesk/maya-usd#575. ProxyRenderDelegate::_FilterSelection() makes the call to PopulateSelection as I have described above, and we look at the resulting selection state at https://github.com/Autodesk/maya-usd/blob/dev/lib/mayaUsd/render/vp2RenderDelegate/mesh.cpp#L1295.
What seems to be happening is the call to _GatherDependencies in PopulateSelection finds a path to all N instances. Then each call to PopulateSelection is on an UsdImagingInstanceAdapter. That gets the UsdImagingDelegate::ALL_INSTANCES parameter and adds N instances. The adding N instances happens N times, so N^2 instanceIndices.
I would expect instanceIndices to contain each index only once. I would also expect the HdSelectionState to have fullySelected=true, but I don't get that either.
Maybe we are making the call to PopulateSelection incorrectly? Or maybe I am interpreting the instanceIndices buffer incorrectly? Any additional information would be helpful.
System Information (OS, Hardware)
Windows
Package Versions
USD v20.05, MayaUSD dev branch at 2164db46
Build Flags
The text was updated successfully, but these errors were encountered: