Exporting USD Files#
There are multiple ways to export USD files using the Omniverse Unity Connector.
Supported USD file types#
USD File Type |
Description |
---|---|
usd |
usd file (binary) |
usdc |
usd file (binary) |
usda |
usd file (text) |
usdz |
usdz file (Uncompressed zipped file of textures and usd files) |
Exporting USD#
Render Pipeline Support#
Render Pipeline |
Available Shader |
---|---|
Built-in |
Standard |
URP |
Universal Render Pipeline/LitUniversal Render Pipeline/Complex Lit (When using Clearcoat) |
HDRP |
HDRP/Lit |
Path hierarchy for USD export#
When USD is exported, the Prim path hierarchy will look like this.
World (defaultPrim)
Scene name
Geometry
Within the “Geometry”, the Prim hierarchy is placed, identical to the Unity Editor hierarchy.
Transform elements#
Rotation to replace Up Axis (Y-Up to Z-Up)
metersPerUnit scale conversion (meters to centimeters)
Exporting Environments as Dome Lights#
Skyboxes in Unity allow the user to specify HDR or EXR files as background, light-casting images. For skyboxes to export through the Unity Connector, they must be applied as the Skybox Materials under Lighting -> Environment settings.
Supported shaders are Skybox/Panoramic, Skybox/Cubemap, and Skybox/Procedural. If the latter type is chosen, the Directional Light chosen will act as the Sun Source.
Skyboxes assigned to Scenes are converted to DomeLights when exporting to the USD. At this time, the Scene’s Skybox is baked, written as an equirectangular EXR file.
> Note: DomeLights are not exported when exporting from the “Export To USD” menu.
Before export, set the resolution of the HDRI to be used for the DomeLight. This is found in the Omniverse Settings under Export DomeLight. The default is None, which means no DomeLight will be exported. Choosing a resolution will enable DomeLight creation at export time.
Limitations due to USD specifications#
If the GameObject name is not ASCII alphanumeric or ‘_’, the Prim name characters will be replaced with ‘_’ during export.
In the exported Prim name, numbers cannot be used as the first character. In this case, ‘_’ is added to the beginning of the Prim name.
If the GameObject name is not an ASCII string, the prim name is replaced with something like “GameObject_1”. At this time, the same name as the GameObject is stored in DisplayName.
Export Targets#
The following is a list of export targets.
Scene hierarchy
Mesh
Lights
Camera
Physics (RigidBody, Collider, Physics Joint, Articulation)
Display Color / Display Opacity
Mesh vertex colors
Skin and Skeleton
Parameters passed to USD#
GameObjects without mesh are exported as Xforms with transforms.
Mesh exports vertices, normal vectors, UVs, and triangle vertex indices.
Lights export Directional Light, Point Light, Spot Light, and Area Light.
Camera can export either Perspective or Orthographic.
DisplayColor and DisplayOpacity are output if the mesh has a vertex color and is assigned a material that uses a VertexColor shader.
Render Pipeline |
Description |
---|---|
Built-in |
StandardVertexColor.shader |
URP |
SrpVertexColor.shadergraph |
HDRP |
SrpVertexColor_HDRP.shadergraph |
Parameters not supported when exporting USD#
Kind
Purpose
Multiple UVs in Mesh
USD Export: Prefab as Payload support#
Instructions for exporting Unity Prefab as a USD Payload#
Override in Prefab#
The following elements can be overridden.
Transform of GameObject
Visibility of GameObject
Binding of GameObject materials
Physics parameters of GameObject
Note
The following are NOT available in a Prefab: Moving between hierarchies within a Prefab and Delete GameObject in Prefab.
USD Stage Hierarchy output from a Prefab#
The USD output of a Prefab will have the following USD Stage Prim structure.
Note
This is the current specification and is subject to change in the future.
Live Sync#
Note
The new asset Prefab is not output to another USD file.
Prim Name / Display Name for Non-ASCII#
Rules for USD Prim name#
The following rules apply to USD Prim names.
ASCII alphanumeric characters and ’_’ are allowed as prim names.
The first character of the Prim name cannot be a number.
For example, the following Prim names can be used.
Sphere
_Sphere
Sphere_1
The following cannot be used as Prim names.
Object : -10
球
2_sphere
Prim name conversion in USD export#
For non-ASCII strings#
The GameObject name “球” is replaced with “GameObject_1” because it is UTF-8.
For ASCII strings#
If the GameObject name is an ASCII string and there are characters that do not match the USD Prim name rules, they will be replaced with ’_’.
For example: “Object : -10” is replaced by “Object____10”.
Display Name#
In the Omniverse Unity Connector’s USD export, if the GameObject name is not allowed as the USD Prim name, the original GameObject name is stored in the DisplayName.
If you are using a UTF-8 DisplayName, you must specify the font for that language at the startup of USD Composer.