Skip to content

Instantly share code, notes, and snippets.

@spatial-bit
Last active January 15, 2022 01:00
Show Gist options
  • Save spatial-bit/a2120754fa71978055b82cf198d4820d to your computer and use it in GitHub Desktop.
Save spatial-bit/a2120754fa71978055b82cf198d4820d to your computer and use it in GitHub Desktop.
USD get transform property+ #USD #OMNIVERSE
# USD get transform property at path
import omni.usd
prim_path = '/Motions/traj_'
stage = omni.usd.get_context().get_stage()
prop = stage.GetPropertyAtPath(f"{prim_path}.xformOp:transform")
value = prop.Get()
print(value)
# or
# get transform operator for target prim
import omni.usd
from pxr import UsdGeom
prim_path = '/Motions'
stage = omni.usd.get_context().get_stage()
tx_prop = UsdGeom.Xform.Get(stage, prim_path)
print(tx)
# and
# get timesamples
timestamps = tx_prop.GetTimeSamples()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment