Skip to content

Instantly share code, notes, and snippets.

@spatial-bit
Created January 25, 2022 23:02
Show Gist options
  • Save spatial-bit/70ca4ba032a791bf60a587dea258f4ba to your computer and use it in GitHub Desktop.
Save spatial-bit/70ca4ba032a791bf60a587dea258f4ba to your computer and use it in GitHub Desktop.
USD more get cameras #USD #OMNIVERSE
# def _get_cameras(stage, filter) -> typing.List:
# """ Get all cameras in the scene except for the ones that are excluded (ie: Perspective, Top, Left, Right cameras)
# """
# cameras = {}
# for prim in Usd.PrimRange(stage.GetPseudoRoot()):
# if prim.IsA(UsdGeom.Camera) and prim.GetName():
# if filter in prim.GetPath().pathString:
# cameras[prim.GetName()] = prim.GetPath().pathString
# return cameras
# cameras = _get_cameras(stage, '/rig/')
# for camera in cameras:
# print(cameras[camera])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment