Find All the Prims of a Given Type

If you want to find all of the prims of a certain type, you can Traverse the stage and use Usd.Prim.IsA() to compare the type of every prim on the stage with the type you are looking for.


from pxr import UsdGeom

# e.g., find all prims of type UsdGeom.Mesh
mesh_prims = [x for x in stage.Traverse() if x.IsA(UsdGeom.Mesh)]


This will be slow for stages with many prims, as stage traversal is currently single-threaded. Learn more about scene complexity.