Table of Contents

Class MaterialExtract

Namespace
ValveResourceFormat.IO
Assembly
ValveResourceFormat.dll

Extracts Source 2 materials to editable vmat format.

public sealed class MaterialExtract

Inheritance

Inherited Members

Constructors

MaterialExtract(Material, ResourceEditInfo, IFileLoader, IShaderDataProvider)

Initializes a new instance of the ValveResourceFormat.IO.MaterialExtract class.

public MaterialExtract(Material material, ResourceEditInfo editInfo, IFileLoader fileLoader, IShaderDataProvider shaderDataProvider = null)

Parameters

material Material
editInfo ResourceEditInfo
fileLoader IFileLoader
shaderDataProvider IShaderDataProvider

MaterialExtract(Resource, IFileLoader)

Initializes a new instance of the ValveResourceFormat.IO.MaterialExtract class.

public MaterialExtract(Resource resource, IFileLoader fileLoader = null)

Parameters

resource Resource
fileLoader IFileLoader

Methods

GetTextureUnpackInfos(string, string, Texture, bool, bool)

Gets the texture unpacking information for a material texture parameter.

public IEnumerable<MaterialExtract.UnpackInfo> GetTextureUnpackInfos(string textureType, string texturePath, Texture texture, bool omitDefaults, bool omitUniforms)

Parameters

textureType string
texturePath string
texture Texture
omitDefaults bool
omitUniforms bool

Returns

IEnumerable<MaterialExtract.UnpackInfo>

OutTextureName(string, bool, bool, string)

Generates the output texture file name from a compiled texture path.

public static string OutTextureName(string texturePath, bool keepOriginalExtension, bool hdr, string desiredSuffix = null)

Parameters

texturePath string
keepOriginalExtension bool
hdr bool
desiredSuffix string

Returns

string

ToContentFile()

Converts the material to a content file with associated textures.

public ContentFile ToContentFile()

Returns

ContentFile

ToValveMaterial()

Converts the material to Valve material format as a string.

public string ToValveMaterial()

Returns

string