PixarAnimationStudios / OpenUSD

Universal Scene Description
http://www.openusd.org
Other
6.15k stars 1.22k forks source link

Performance issue when selecting prim with a large number of children #1451

Open csyshing opened 3 years ago

csyshing commented 3 years ago

Description of Issue

Hi,

We found a performance issue when selecting a top-level prim with a large number of children, e.g., a super big environment set in a shot.

We noticed this problem in mayaUsd plugin at first (https://github.com/Autodesk/maya-usd/issues/1004), and narrowed it down to the API UsdImagingDelegate::PopulateSelection() that this method always recursively traverses into all children, this slows down the interactive performance quite a lot especially for large sets.

(Creating this issue as per discussion in public mailing)

Steps to Reproduce

  1. Load the Pixar kitchen set
  2. Enable the debug symbol USDIMAGING_SELECTION (either from environment variable or Python)
  3. Select any parent prim, for example /Kitchen_set/Arch_grp, the console would output something like these:
    PopulateSelection: (prim) /Proxy_KitchensetShape_0x1538cc60/Kitchen_set/Arch_grp/Kitchen_1/Geom/Cabinets/Body/pCube251
    PopulateSelection: (prim) /Proxy_KitchensetShape_0x1538cc60/Kitchen_set/Arch_grp/Kitchen_1/Geom/Cabinets/Body/pCube277
    PopulateSelection: (prim) /Proxy_KitchensetShape_0x1538cc60/Kitchen_set/Arch_grp/Kitchen_1/Geom/Cabinets/Body/pCube278
    ...
    ...
    PopulateSelection: (prim) /Proxy_KitchensetShape_0x1538cc60/Kitchen_set/Arch_grp/Kitchen_1/Geom/Windows_Frame/WindowStill/Window_Frame_Arch/pCube79
    PopulateSelection: (prim) /Proxy_KitchensetShape_0x1538cc60/Kitchen_set/Arch_grp/Kitchen_1/Geom/Windows_Frame/WindowStill/Window_Frame_Arch/pCylinder217
    PopulateSelection: (prim) /Proxy_KitchensetShape_0x1538cc60/Kitchen_set/Arch_grp/Kitchen_1/Geom/Windows_Frame/pCube421

System Information (OS, Hardware)

OS: Centos 7.4

Package Versions

USD-19.11 and USD-20.11

jilliene commented 3 years ago

Filed as internal issue #USD-6572