USDScene : Load bounds from UsdGeomModelAPI extents hints #1421
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This can provide significant performance improvements where the ModelAPI has been used to provide cached extents. This knocks around 30% off the time taken to open the file and compute the root bound of the ALab in Gaffer. If USD composition time is omitted so only the bound computation is measured in isolation, a full 95% is knocked off the time. In the case of the ALab, the new root bound is also far more reasonable for some reason - I suspect the model extents are masking a bad authored extent on a leaf object elsewhere in the scene.
This has the potential to be surprising for any folks who have authored inaccurate model extents in the past, so I've made it possible to turn off the behaviour using an environment variable. I'd like to default things on in Cortex itself, but we can debate the appropriate default for Gaffer when we next update the Cortex version.