I am working with a UsdImagingGprimAdapter
that has some relatively expensive computations in UpdateForTime
and GetTopology
. At the moment it has been implemented with an early exit clause if the prim is hidden.
When playing back animation in usdview if the prim is hidden I get the same frame rate as if the prim was deactivated. When the prim is not hidden, the frame rate drops even if its display purpose is turned off (it is usually a “render” prim) even if the geometry is not visible in the viewport as expected. The logs indicate that the expensive computations in UpdateForTime
are running.
I have been looking at UsdSkelImagingSkeletonAdapter
to understand how expensive calculations should be avoided when visibility or purpose end up hiding the prim’s geometry but haven’t found anything that explicitly suggest how prim adapters are meant to behave in this situation. Any tips or examples?
I am using Usd 21.11.