// SPDX-FileCopyrightText: 2023 Unity Technologies and the glTFast authors // SPDX-License-Identifier: Apache-2.0 using System; using UnityEngine; namespace GLTFast.Export { /// /// glTF format /// public enum GltfFormat { /// /// JSON-based glTF (.gltf file extension) /// Json, /// /// glTF-binary (.glb file extension) /// Binary } /// /// Destination for image files /// public enum ImageDestination { /// /// Automatic decision. Main buffer for glTF-binary, separate files for JSON-based glTFs. /// Automatic, /// /// Embeds images in main buffer /// MainBuffer, /// /// Saves images as separate files relative to glTF file /// SeparateFile } /// /// Resolutions to existing file conflicts /// public enum FileConflictResolution { /// /// Abort and keep existing files /// Abort, /// /// Replace existing files with newly created ones /// Overwrite } /// /// glTF compression method. /// [Flags] public enum Compression { /// No compression Uncompressed = 1, /// Meshopt compression /// via MeshOpt = 1 << 1, /// Draco 3D Data compression /// via Draco = 1 << 2, } /// /// glTF export settings /// public class ExportSettings { /// /// Export to JSON-based or binary format glTF files /// public GltfFormat Format { get; set; } = GltfFormat.Json; /// public ImageDestination ImageDestination { get; set; } = ImageDestination.Automatic; /// public FileConflictResolution FileConflictResolution { get; set; } = FileConflictResolution.Abort; /// /// Light intensity values are multiplied by this factor. /// [field: Tooltip("Light intensity values are multiplied by this factor")] public float LightIntensityFactor { get; set; } = 1.0f; /// /// Component type flags to include or exclude components from export /// based on type. /// public ComponentType ComponentMask { get; set; } = ComponentType.All; /// /// Type of compression to apply /// public Compression Compression { get; set; } = Compression.Uncompressed; /// /// Draco compression export settings /// public DracoExportSettings DracoSettings { get; set; } /// /// If true, the export results will not differ on repeated exports. This comes at the cost of potentially /// longer export times on scenes with multiple, large meshes. /// This can be a requirement for certain asset pipelines or automated tests. /// public bool Deterministic { get; set; } /// /// Controls which vertex attributes are preserved during export, regardless whether they are used/referenced /// or not. By default, unused attributes are discarded. /// public VertexAttributeUsage PreservedVertexAttributes { get; set; } = VertexAttributeUsage.None; /// /// [1-100] quality for JPG images /// public int JpgQuality { get; set; } = 60; } }