"""Scan the new 90/45 scene: exact belt geometry, plow decks, and containers.""" import omni.usd from pxr import Usd, UsdGeom, UsdPhysics stage = omni.usd.get_context().get_stage() bbc = UsdGeom.BBoxCache(Usd.TimeCode.Default(), [UsdGeom.Tokens.default_, UsdGeom.Tokens.render]) xc = UsdGeom.XformCache() def report(path): prim = stage.GetPrimAtPath(path) if not prim.IsValid(): print(f"{path} MISSING") return r = bbc.ComputeWorldBound(prim).ComputeAlignedRange() mn, mx = r.GetMin(), r.GetMax() M = xc.GetLocalToWorldTransform(prim) localx = M.TransformDir((1,0,0)) localx = localx / (localx.GetLength() or 1) active = prim.IsActive() print(f"{path} active={active}") print(f" bbox x[{mn[0]:+.3f}..{mx[0]:+.3f}] y[{mn[1]:+.3f}..{mx[1]:+.3f}] z[{mn[2]:+.3f}..{mx[2]:+.3f}]") print(f" local+X in world = ({localx[0]:+.3f},{localx[1]:+.3f},{localx[2]:+.3f})") kids = [c.GetName() for c in prim.GetChildren()] print(f" children: {kids}") print("=== root-level /ConveyorTrack_01 duplicate check ===") p = stage.GetPrimAtPath("/ConveyorTrack_01") print("exists:", p.IsValid()) for path in ["/World/ConveyorTrack_04", "/World/ConveyorTrack_04/Belt", "/World/ConveyorTrack_06", "/World/ConveyorTrack_06/Belt", "/World/ConveyorTrack_01", "/World/ConveyorTrack_01/Belt", "/World/PlowCornerDeck_B", "/World/PlowCornerDeck_C", "/World/PlowTransition_B", "/World/PlowTransition_C", "/World/PlowContainers", "/World/Diverters/DiverterEnd"]: report(path) print() print("=== PlowContainers full subtree ===") pc = stage.GetPrimAtPath("/World/PlowContainers") if pc.IsValid(): for c in Usd.PrimRange(pc): r = bbc.ComputeWorldBound(c).ComputeAlignedRange() if not r.IsEmpty(): mn, mx = r.GetMin(), r.GetMax() print(f" {c.GetPath()} type={c.GetTypeName()} " f"x[{mn[0]:+.2f}..{mx[0]:+.2f}] y[{mn[1]:+.2f}..{mx[1]:+.2f}] z[{mn[2]:+.2f}..{mx[2]:+.2f}]")