Last active
January 15, 2022 01:00
-
-
Save spatial-bit/a2120754fa71978055b82cf198d4820d to your computer and use it in GitHub Desktop.
USD get transform property+ #USD #OMNIVERSE
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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