[EMSUSD-2199] UFE4 find all cameras very slow
- Dominant language
- Wolfram Language
- Stars
- 905
- Forks
- 223
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 17
Description
Pixar's current referenceAssembly approach to its set construction workflow results in a single Maya scene containing potentially thousands of ProxyShapes - essentially one per asset in the set. Users have noticed that selecting the Panels > Perspective menu was very slow to populate - on the order of 20 seconds or so - if there are a large number of ProxyShape nodes loaded.
I tracked the slowness down to an O(n^2) operation that UFE4's Find All Cameras logic triggers. It appears that for each node in the scene, this logic makes a call into the `find_` function of each camera handler - one call into the `ProxyShapeCameraHandler` and another call into the `UsdCameraHandler`. Then, for each node, it triggers a call to `findUsdGatewayItems`, which calls `getAllStages`, which traverses the entire scene getting each proxyShape, hence the O(n^2) growth rate.
I haven't been able to track down the call to `findUsdGatewayItems` in the open source mayaUsd code so I assume the call is within UFE itself. I'm curious if this call or the call to `getAllStages` is necessary to perform for each ProxyShape node in the scene, or if it may be cached internally to avoid all this redundant work?
This was also slow in UFE3, but we're just chasing it down now. I can generate an example test scene if needed.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.