How to query USD prim World Bounding Box

   2413   0   2
User Avatar
Member
55 posts
Joined: April 2019
Offline
A very simple question which seems to be tricky to figure out! All geom prims have a World Bounding Box shown in Solaris Scene Graph Details. How does one access that via Python and Vex?! I've tried the following, but I get inconsistent results that are not the same as what's shown in Scene Graph Details!

from pxr import Usd, UsdGeom

node = hou.pwd()
stage = node.editableStage()

prim = stage.GetPrimAtPath('/scene/geo/cube')
bbox_cache = UsdGeom.BBoxCache(0, ['default'])
bbox = bbox_cache.ComputeWorldBound(prim).box

print bbox
VFX Supervisor | CG Artist

http://yasinhasanian.com/ [yasinhasanian.com]
  • Quick Links