mrtk_developmentreleases/2.0.0releases/2.1.0releases/2.2.0

    Show / Hide Table of Contents

    Class OBJWriterUtility

    Utility for generating and saving OBJ files from GameObjects and their Meshes

    Inheritance
    Object
    OBJWriterUtility
    Inherited Members
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: Microsoft.MixedReality.Toolkit.Utilities
    Assembly: cs.temp.dll.dll
    Syntax
    public static class OBJWriterUtility

    Methods

    CreateOBJFileContentAsync(GameObject, Boolean)

    Coroutine async method that generates string in OBJ file format of provided GameObject's Mesh, and possibly children.

    Declaration
    public static IEnumerator<string> CreateOBJFileContentAsync(GameObject target, bool includeChildren)
    Parameters
    Type Name Description
    GameObject target

    GameObject to target for pulling MeshFilter data

    Boolean includeChildren

    Include Mesh data of children GameObjects as sub-meshes in output

    Returns
    Type Description
    IEnumerator<String>

    string of all mesh data (no materials) in OBJ file format

    CreateOBJFileContentAsync(GameObject, Boolean)

    Coroutine async method that generates string in OBJ file format of provided GameObject's Mesh, and possibly children.

    Declaration
    public static IEnumerator<string> CreateOBJFileContentAsync(GameObject target, bool includeChildren)
    Parameters
    Type Name Description
    GameObject target

    GameObject to target for pulling MeshFilter data

    Boolean includeChildren

    Include Mesh data of children GameObjects as sub-meshes in output

    Returns
    Type Description
    IEnumerator<String>

    string of all mesh data (no materials) in OBJ file format

    ExportOBJAsync(GameObject, String, Boolean)

    Export mesh data of provided GameObject, and children if enabled, to file provided in OBJ format

    Declaration
    public static Task ExportOBJAsync(GameObject root, string filePath, bool includeChildren = true)
    Parameters
    Type Name Description
    GameObject root
    String filePath
    Boolean includeChildren
    Returns
    Type Description
    Task
    Remarks

    Traversal of GameObject mesh data is done via Coroutine on main Unity thread due to limitations by Unity. If a file does not exist at given file path, a new one is automatically created If applicable, children Mesh data will be bundled into same OBJ file.

    ExportOBJAsync(GameObject, String, Boolean)

    Export mesh data of provided GameObject, and children if enabled, to file provided in OBJ format

    Declaration
    public static Task ExportOBJAsync(GameObject root, string filePath, bool includeChildren = true)
    Parameters
    Type Name Description
    GameObject root
    String filePath
    Boolean includeChildren
    Returns
    Type Description
    Task
    Remarks

    Traversal of GameObject mesh data is done via Coroutine on main Unity thread due to limitations by Unity. If a file does not exist at given file path, a new one is automatically created If applicable, children Mesh data will be bundled into same OBJ file.

    In This Article
    • Methods
      • CreateOBJFileContentAsync(GameObject, Boolean)
      • CreateOBJFileContentAsync(GameObject, Boolean)
      • ExportOBJAsync(GameObject, String, Boolean)
      • ExportOBJAsync(GameObject, String, Boolean)
    Back to top Generated by DocFX