Class GltfModelExporter
Namespace: ValveResourceFormat.IO
Assembly: ValveResourceFormat.dll
Exports Valve resources to glTF 2.0 format.
public class GltfModelExporterInheritance
Constructors
GltfModelExporter(IFileLoader)
Initializes a new instance of the class.
public GltfModelExporter(IFileLoader fileLoader)Parameters
fileLoader IFileLoader
Fields
GltfTextureMappings
Maps glTF texture types to their channel configurations and Valve texture names.
public static readonly Dictionary<string, (ChannelMapping Channel, string Name)[]> GltfTextureMappingsField Value
Dictionary<string, (ChannelMapping Channel, string Name)[]>
SupportedGltfChannels
Gets all supported glTF texture channels from the mappings.
public static readonly (ChannelMapping Channel, string Name)[] SupportedGltfChannelsField Value
(ChannelMapping Channel, string Name)[]
Properties
AdaptTextures
Gets or sets a value indicating whether to adapt textures for glTF compatibility.
public bool AdaptTextures { get; set; }Property Value
AnimationFilter
Gets the set of animation names to filter during export.
public HashSet<string> AnimationFilter { get; }Property Value
ExportAnimations
Gets or sets a value indicating whether to export animations.
public bool ExportAnimations { get; set; }Property Value
ExportExtras
Gets or sets a value indicating whether to export extra data.
public bool ExportExtras { get; set; }Property Value
ExportMaterials
Gets or sets a value indicating whether to export materials.
public bool ExportMaterials { get; set; }Property Value
FileLoader
Gets the file loader for loading referenced resources.
public IFileLoader FileLoader { get; }Property Value
MeshFilter
Gets the set of mesh names to filter during export. The filter does not apply when exporting a vmesh resource.
public HashSet<string> MeshFilter { get; }Property Value
ProgressReporter
Gets or sets the progress reporter for export operations.
public required IProgress<string> ProgressReporter { get; set; }Property Value
SatelliteImages
Gets or sets a value indicating whether to save satellite images separately.
public bool SatelliteImages { get; set; }Property Value
Methods
CanExport(Resource)
Determines whether the specified resource can be exported to glTF.
public static bool CanExport(Resource resource)Parameters
resource Resource
Returns
Export(Resource, string?, CancellationToken)
Export a Valve resource to glTF.
public void Export(Resource resource, string? targetPath, CancellationToken cancellationToken = default)Parameters
resource Resource
The resource being exported.
targetPath string?
Target file name.
cancellationToken CancellationToken
Optional task cancellation token
Export(NavMeshFile, string, string?, CancellationToken)
Export a navigation mesh to glTF.
public void Export(NavMeshFile navMesh, string resourceName, string? targetPath, CancellationToken cancellationToken = default)Parameters
navMesh NavMeshFile
The navigation mesh to export.
resourceName string
The name of the resource being exported.
targetPath string?
Target file name.
cancellationToken CancellationToken
Optional task cancellation token.
Export(NavMeshFile, string, Stream, CancellationToken)
Export a navigation mesh to a GLB stream.
public void Export(NavMeshFile navMesh, string resourceName, Stream stream, CancellationToken cancellationToken = default)Parameters
navMesh NavMeshFile
The navigation mesh to export.
resourceName string
The name of the resource being exported.
stream Stream
Target stream to write GLB data to.
cancellationToken CancellationToken
Optional task cancellation token.
ReadIndices(OnDiskBufferData, int, int, int)
Reads indices from an index buffer and applies a base vertex offset.
public static int[] ReadIndices(VBIB.OnDiskBufferData indexBuffer, int start, int count, int baseVertex)Parameters
indexBuffer VBIB.OnDiskBufferData
start int
count int
baseVertex int
Returns
int[]

