We've moved!

Starting from MRTK 2.6, we are publishing both conceptual docs and API references on docs.microsoft.com. For conceptual docs, please visit our new landing page. For API references, please visit the MRTK-Unity section of the dot net API explorer. Existing content will remain here but will not be updated further.

Search Results for

    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

    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
    Back to top Generated by DocFX