Skip to content

Instantly share code, notes, and snippets.

@spatial-bit
Created January 13, 2022 19:04
Show Gist options
  • Save spatial-bit/4be2d02ffb2657a9040322b6950873e5 to your computer and use it in GitHub Desktop.
Save spatial-bit/4be2d02ffb2657a9040322b6950873e5 to your computer and use it in GitHub Desktop.
USD create camera #USD #OMNIVERSE
# USD create camera and set attributes
import omni.usd
from pxr import UsdGeom, Gf, Usd, UsdGeom, Vt, Sdf
stage = omni.usd.get_context().get_stage()
camera = UsdGeom.Camera.Define(stage, f'/Motions/my_camera0')
camera.CreateClippingRangeAttr().Set((1,1000000)) # e.g. (1, 1000000)
# camera.AddTransformOp().Set(tx)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment