Table of Contents

Class GltfModelExporter

Namespace
ValveResourceFormat.IO
Assembly
ValveResourceFormat.dll

Exports Valve resources to glTF 2.0 format.

public class GltfModelExporter

Inheritance

Inherited Members

Constructors

GltfModelExporter(IFileLoader)

Initializes a new instance of the ValveResourceFormat.IO.GltfModelExporter 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)[]> GltfTextureMappings

Field Value

Dictionary<string, (ChannelMapping Channel, string Name)[]>

SupportedGltfChannels

Gets all supported glTF texture channels from the mappings.

public static readonly (ChannelMapping Channel, string Name)[] SupportedGltfChannels

Field 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

bool

AnimationFilter

Gets the set of animation names to filter during export.

public HashSet<string> AnimationFilter { get; }

Property Value

HashSet<string>

ExportAnimations

Gets or sets a value indicating whether to export animations.

public bool ExportAnimations { get; set; }

Property Value

bool

ExportExtras

Gets or sets a value indicating whether to export extra data.

public bool ExportExtras { get; set; }

Property Value

bool

ExportMaterials

Gets or sets a value indicating whether to export materials.

public bool ExportMaterials { get; set; }

Property Value

bool

FileLoader

Gets the file loader for loading referenced resources.

public IFileLoader FileLoader { get; }

Property Value

IFileLoader

ProgressReporter

Gets or sets the progress reporter for export operations.

public required IProgress<string> ProgressReporter { get; set; }

Property Value

IProgress<string>

SatelliteImages

Gets or sets a value indicating whether to save satellite images separately.

public bool SatelliteImages { get; set; }

Property Value

bool

Methods

CanExport(Resource)

Determines whether the specified resource can be exported to glTF.

public static bool CanExport(Resource resource)

Parameters

resource Resource

Returns

bool

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

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[]