Struct WorldNode.MaterialOverride ​
Namespace: ValveResourceFormat.ResourceTypes
Assembly: ValveResourceFormat.dll
A material that replaces the material of a single draw call of one of WorldNode.SceneObjects, or of every draw call of that scene object when WorldNode.MaterialOverride.DrawCallIndex is WorldNode.MaterialOverride.AllDrawCalls.
public readonly record struct WorldNode.MaterialOverride : IEquatable<WorldNode.MaterialOverride>Implements ​
IEquatable<WorldNode.MaterialOverride>
Constructors ​
MaterialOverride(uint, uint, uint, string) ​
A material that replaces the material of a single draw call of one of WorldNode.SceneObjects, or of every draw call of that scene object when WorldNode.MaterialOverride.DrawCallIndex is WorldNode.MaterialOverride.AllDrawCalls.
public MaterialOverride(uint SceneObjectIndex, uint SubSceneObject, uint DrawCallIndex, string Material)Parameters ​
SceneObjectIndex uint
Index into WorldNode.SceneObjects.
SubSceneObject uint
Index of the mesh within the scene object's model, ignored for WorldNode.MaterialOverride.AllDrawCalls.
DrawCallIndex uint
Index of the draw call within the mesh, or WorldNode.MaterialOverride.AllDrawCalls.
Material string
Name of the replacement material.
See Also ​
Fields ​
AllDrawCalls ​
The WorldNode.MaterialOverride.DrawCallIndex that replaces the material of every draw call of every mesh of the model. The first such override of a scene object wins and its single draw call overrides are not applied.
public const uint AllDrawCalls = 4294967295Field Value ​
uint
Properties ​
DrawCallIndex ​
Index of the draw call within the mesh, or WorldNode.MaterialOverride.AllDrawCalls.
public uint DrawCallIndex { get; init; }Property Value ​
uint
IsWholeModel ​
Gets whether this override replaces the material of every draw call of the model.
public bool IsWholeModel { get; }Property Value ​
bool
Material ​
Name of the replacement material.
public string Material { get; init; }Property Value ​
string
SceneObjectIndex ​
Index into WorldNode.SceneObjects.
public uint SceneObjectIndex { get; init; }Property Value ​
uint
SubSceneObject ​
Index of the mesh within the scene object's model, ignored for WorldNode.MaterialOverride.AllDrawCalls.
public uint SubSceneObject { get; init; }Property Value ​
uint
Methods ​
Find(IReadOnlyList<MaterialOverride>, int, int) ​
Gets the material that replaces one draw call of a scene object's model, or null when the draw call keeps its material.
public static string? Find(IReadOnlyList<WorldNode.MaterialOverride> materialOverrides, int meshIndex, int drawCallIndex)Parameters ​
materialOverrides IReadOnlyList<WorldNode.MaterialOverride>
The overrides of the scene object.
meshIndex int
Index of the mesh within the model.
drawCallIndex int
Index of the draw call within the mesh, counted over all its scene objects.
Returns ​
string?

