docs.unity3d.com
    Show / Hide Table of Contents

    Class MeshImporter

    A collection of methods used for importing USD Mesh data into Unity.

    Inheritance
    Object
    MeshImporter
    Inherited Members
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    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
    Back to top
    Copyright © 2023 Unity Technologies
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on Thursday, October 19, 2023