docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class GltfWriter

    Provides glTF export independent of workflow (GameObjects/Entities)

    Inheritance
    object
    GltfWriter
    Implements
    IGltfWritable
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: GLTFast.Export
    Assembly: solution.dll
    Syntax
    public class GltfWriter : IGltfWritable

    Constructors

    Name Description
    GltfWriter(ExportSettings, IDeferAgent, ICodeLogger)

    Provides glTF export independent of workflow (GameObjects/Entities)

    Methods

    Name Description
    AddCamera(Camera, out int)

    Creates a glTF camera based on a Unity camera

    AddCameraToNode(int, int)

    Assigns a camera to a previously added node

    AddImage(ImageExportBase)

    Adds an ImageExport to the glTF and returns the resulting image index

    AddLight(Light, out int)

    Creates a glTF light based on a Unity light Uses the KHR_lights_punctual extension.

    AddLightToNode(int, int)

    Assigns a light to a previously added node

    AddMaterial(Material, out int, IMaterialExport)

    Adds a Unity material

    AddMeshToNode(int, Mesh, int[])

    Assigns a mesh to a previously added node

    AddNode(float3?, quaternion?, float3?, uint[], string)

    Adds a node to the glTF

    AddSampler(FilterMode, TextureWrapMode, TextureWrapMode)

    Creates a glTF sampler based on Unity filter and wrap settings

    AddScene(uint[], string)

    Adds a scene to the glTF

    AddTexture(int, int)

    Creates a glTF texture from with a given image index

    RegisterExtensionUsage(Extension, bool)

    Registers the use of a glTF extension

    SaveToFileAndDispose(string)

    Exports the collected scenes/content as glTF, writes it to a file and disposes this object. After the export this instance cannot be re-used!

    SaveToStreamAndDispose(Stream)

    Exports the collected scenes/content as glTF, writes it to a Stream and disposes this object. Only works for self-contained glTF-Binary. After the export this instance cannot be re-used!

    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)