Class MeshImporter
A collection of methods used for importing USD Mesh data into Unity.
Inherited Members
Namespace: Unity.Formats.USD
Syntax
public static class MeshImporter
Methods
BuildMesh(String, SanitizedMeshSample, MeshImporter.GeometrySubsets, GameObject, SceneImportOptions, Boolean, UsdSkelSkinningQuery)
Copy mesh data from USD to Unity with the given import options.
Declaration
public static void BuildMesh(string path, SanitizedMeshSample usdMesh, MeshImporter.GeometrySubsets geomSubsets, GameObject go, SceneImportOptions options, bool isDynamic, UsdSkelSkinningQuery skinQuery = null)
Parameters
| Type | Name | Description |
|---|---|---|
| String | path | |
| SanitizedMeshSample | usdMesh | |
| MeshImporter.GeometrySubsets | geomSubsets | |
| GameObject | go | |
| SceneImportOptions | options | |
| Boolean | isDynamic | |
| UsdSkelSkinningQuery | skinQuery |
BuildSkinnedMesh(String, SanitizedMeshSample, MeshImporter.GeometrySubsets, GameObject, SceneImportOptions, Boolean, UsdSkelSkinningQuery)
Copy mesh data from USD to Unity with the given import options, setup for skinning.
Declaration
public static void BuildSkinnedMesh(string path, SanitizedMeshSample usdMesh, MeshImporter.GeometrySubsets geomSubsets, GameObject go, SceneImportOptions options, bool isDynamic, UsdSkelSkinningQuery skinningQuery = null)
Parameters
| Type | Name | Description |
|---|---|---|
| String | path | |
| SanitizedMeshSample | usdMesh | |
| MeshImporter.GeometrySubsets | geomSubsets | |
| GameObject | go | |
| SceneImportOptions | options | |
| Boolean | isDynamic | |
| UsdSkelSkinningQuery | skinningQuery |
ImportSkinning(String, SanitizedMeshSample, Mesh, UsdSkelSkinningQuery)
Import skin weights and joint indices from USD.
Declaration
public static void ImportSkinning(string path, SanitizedMeshSample usdMesh, Mesh unityMesh, UsdSkelSkinningQuery skinningQuery)
Parameters
| Type | Name | Description |
|---|---|---|
| String | path | |
| SanitizedMeshSample | usdMesh | |
| Mesh | unityMesh | |
| UsdSkelSkinningQuery | skinningQuery |
Remarks
JointWeights and JointIndices attribute should probably go into the MeshSample but we might not want to pay the deserialization cost if we don't care about skinning info. Although sanitizing the data would be easier if done by SanitizedMeshSample.Sanitize
ReadGeomSubsets(Scene, String)
Reads geometry subsets if authored. If not authored, returns an empty dictionary.
Declaration
public static MeshImporter.GeometrySubsets ReadGeomSubsets(Scene scene, string path)
Parameters
| Type | Name | Description |
|---|---|---|
| Scene | scene | |
| String | path |
Returns
| Type | Description |
|---|---|
| MeshImporter.GeometrySubsets |
ShouldCompute(ImportMode)
Returns true if the mode is Compute or ImportOrCompute.
Declaration
public static bool ShouldCompute(ImportMode mode)
Parameters
| Type | Name | Description |
|---|---|---|
| ImportMode | mode |
Returns
| Type | Description |
|---|---|
| Boolean |
ShouldImport(ImportMode)
Returns true if the mode is Import or ImportOrCompute.
Declaration
public static bool ShouldImport(ImportMode mode)
Parameters
| Type | Name | Description |
|---|---|---|
| ImportMode | mode |
Returns
| Type | Description |
|---|---|
| Boolean |