A collection of methods used for importing USD Material data into Unity.
Inheritance
MaterialImporter
public static class MaterialImporter
Fields
OnResolveTexture
A callback that allows custom texture resolution logic.
Declaration
public static MaterialImporter.TextureResolver OnResolveTexture
Field Value
Methods
Builds a Unity Material from the given USD material sample.
Declaration
public static Material BuildMaterial(Scene scene, string materialPath, MaterialSample sample, SceneImportOptions options)
Parameters
Returns
| Type |
Description |
| Material |
|
CombineRoughness(Texture2D, Texture2D, String)
Copies the roughness texture into the alpha channel fo the rgb texture, inverting it to
convert roughness into gloss.
Declaration
public static Texture2D CombineRoughness(Texture2D rgbTex, Texture2D roughnessTex, string fileNameSuffix)
Parameters
| Type |
Name |
Description |
| Texture2D |
rgbTex |
|
| Texture2D |
roughnessTex |
|
| String |
fileNameSuffix |
|
Returns
| Type |
Description |
| Texture2D |
|
Reads and returns the UsdPreviewSurface data for the prim at the given path, if present.
Declaration
public static UnityPreviewSurfaceSample GetSurfaceShaderPrim(Scene scene, string primPath)
Parameters
| Type |
Name |
Description |
| Scene |
scene |
The USD scene object.
|
| String |
primPath |
The path to the object in the USD scene.
|
Returns
ImportConnectedTexture<T>(Scene, Connectable<T>, Boolean, SceneImportOptions, out String)
Declaration
public static Texture2D ImportConnectedTexture<T>(Scene scene, Connectable<T> connection, bool isNormalMap, SceneImportOptions options, out string uvPrimvar)
Parameters
Returns
| Type |
Description |
| Texture2D |
|
Type Parameters
Computes the bound material using UsdShade's inherited binding logic.
If a material is bound, the request callback is executed to enable the caller to bind the
material to the Unity geometry.
Declaration
public static void ProcessMaterialBindings(Scene scene, SceneImportOptions importOptions)
Parameters