Code Samples
These Code Samples provide useful examples to help to programmers coding in Omniverse. We cover essential Omniverse python APIs available from Kit and USD Schemas. The most common functionality is covered with descriptions, code examples and screenshots where appropriate. The full API’s are also linked to for a comprehensive reference.
- Audio
- Events
- Extensions
- Input Devices
- Physics
- Python
- Services
- Settings
- User Interface
- USD
- Create an Orthographic Camera
- Create a Perspective Camera
- Convert Between VtArray and Numpy Array
- Find a Prim by Name
- Find All the Prims of a Given Type
- Get the Child of a Prim
- Add an Inherit
- Add a SubLayer
- Create an MDL Material
- Create a UsdPreviewSurface Material
- Concatenate a Prim Path
- Concatenate a Property Name with a Prim Path
- Get the Parent Path for a Prim Path
- Check if a Prim Exists
- Get the Currently Selected Prims
- Get a Prim
- Select a Prim by Prim Path
- Add a Relationship Target
- Check if a Property Exists
- Create an Attribute
- Create a Relationship
- Get the Value of an Attribute
- Get the Targets of a Relationship
- Set the Value of an Attribute
- Add a Payload
- Add a Reference
- Create a Payload
- Create a Reference
- Add a Specialize
- Get the Current Stage
- Set the Default Prim on a Stage
- Set the Stage Linear Units
- Set the Stage Up Axis
- Compute the Bounding Box for a Prim
- Get the Local Space Transforms for a Prim
- Get the World Space Transforms for a Prim
- Author Data for a Particular Variant
- Create a Variant Set
- Select a Variant for a Variant Set
- Show or Hide a Prim
- Viewport