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
| # 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 |
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
| import omni.usd | |
| from pxr import UsdGeom, Usd, UsdGeom | |
| def get_prims_startswith(stage, root_path, starts_with): | |
| matching_prims = [] | |
| root_prim = stage.GetPrimAtPath(root_path) | |
| for prim in Usd.PrimRange(root_prim): | |
| if prim.GetName().startswith(starts_with): | |
| matching_prims.append(prim) | |
| return matching_prims |
OlderNewer