GUI/Types/Exporter/GltfModelExporter.cs
/// <summary>
/// Export a Valve VMESH to Gltf.
/// </summary>
/// <param name="resourceName">The name of the resource being exported.</param>
/// <param name="fileName">Target file name.</param>
/// <param name="mesh">The mesh resource to export.</param>
Export a Valve VMESH to Gltf.
Export a Valve VMESH to Gltf .
public void ExportToFile(string resourceName, string fileName, VMesh mesh)
        {
            var exportedModel = ModelRoot.CreateModel();
            exportedModel.Asset.Generator = GENERATOR;
            var name = Path.GetFileName(resourceName);
            var scene = exportedModel.UseScene(name);
            var exportedMesh = CreateGltfMesh(name, mesh, exportedModel, false);
            var meshNode = scene.CreateNode(name)
                .WithMesh(exportedMesh);
            meshNode.WorldMatrix = TRANSFORMSOURCETOGLTF;
            exportedModel.Save(fileName);
        }
public void ExportToFile ( string resourceName , string fileName , VMesh mesh ) { var exportedModel = ModelRoot . CreateModel ( ) ; exportedModel . Asset . Generator = GENERATOR ; var name = Path . GetFileName ( resourceName ) ; var scene = exportedModel . UseScene ( name ) ; var exportedMesh = CreateGltfMesh ( name , mesh , exportedModel , false ) ; var meshNode = scene . CreateNode ( name ) . WithMesh ( exportedMesh ) ; meshNode . WorldMatrix = TRANSFORMSOURCETOGLTF ; exportedModel . Save ( fileName ) ; }
Export a Valve VMESH to Gltf.
Export a Valve VMESH to Gltf .
// Swap Rotate upright, scale inches to meters.
resourceName
string
The name of the resource being exported.
The name of the resource being exported .
fileName
string
Target file name.
Target file name .
mesh
VMesh
The mesh resource to export.
The mesh resource to export .