# UsdImagingGprimAdapter with expensive per-frame updates

**URL:** <https://forum.aousd.org/t/usdimaginggprimadapter-with-expensive-per-frame-updates/1997>\
**Category:** Hydra\
**Created:** [November 12, 2024, 9:39pm UTC](https://forum.aousd.org/t/usdimaginggprimadapter-with-expensive-per-frame-updates/1997 "2024-11-12T21:39:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![lpedroni](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.aousd.org/lpedroni/32/682_2.png) [@lpedroni](https://forum.aousd.org/u/lpedroni)\
**Post date:** [November 12, 2024, 9:39pm UTC](https://forum.aousd.org/t/usdimaginggprimadapter-with-expensive-per-frame-updates/1997/1 "2024-11-12T21:39:33Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![JerryK](https://avatars.discourse-cdn.com/v4/letter/j/b4bc9f/32.png) [@JerryK](https://forum.aousd.org/u/JerryK)\
**Post date:** [November 14, 2024, 9:55pm UTC](https://forum.aousd.org/t/usdimaginggprimadapter-with-expensive-per-frame-updates/1997/2 "2024-11-14T21:55:38Z")

</div>

Hi,I’d like to add some more information to above. In the custom prim adapter, we are using  
UsdGeom.Imageable(prim).ComputeVisibility() to do decide the enable/disable computation.  
Dont know if it’s possible to get the Display Purpose of Hydra settings in UsdImagingGprimAdapter and then we can do something different if it’s not included in the Display Purpose.
