Skip to content

Instantly share code, notes, and snippets.

@spatial-bit
Created January 21, 2022 20:16
Show Gist options
  • Save spatial-bit/d89f4cc7d861ffb69697a491de82f320 to your computer and use it in GitHub Desktop.
Save spatial-bit/d89f4cc7d861ffb69697a491de82f320 to your computer and use it in GitHub Desktop.
USD Reading transforms/animations from a stage #USD #OMNIVERSE
from pxr import UsdGeom, Usd
stage_path = "D:\\Source\\internal\\projects\\example_simgen\\input\\stage_xxx2usd.usda"
stage = Usd.Stage.Open(stage_path)
prim_path = "/stage/Device_rig"
tx_prop = UsdGeom.Xform.Get(stage, prim_path)
times = tx_prop.GetTimeSamples()
transforms = []
for time in times:
transforms.append(tx_prop.GetLocalTransformation(time=time))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment