Class Mesh
Namespace: ValveResourceFormat.ResourceTypes
Assembly: ValveResourceFormat.dll
Represents a mesh resource containing geometry and vertex buffer data.
public class Mesh : KeyValuesOrNTROInheritance
object ← Block ← KeyValuesOrNTRO ← Mesh
Inherited Members
KeyValuesOrNTRO.Type, KeyValuesOrNTRO.Data, KeyValuesOrNTRO.Format, KeyValuesOrNTRO.Read(BinaryReader), KeyValuesOrNTRO.Serialize(Stream), KeyValuesOrNTRO.WriteText(IndentedTextWriter), Block.Type, Block.Offset, Block.Size, Block.Resource, Block.Read(BinaryReader), Block.ToString(), Block.WriteText(IndentedTextWriter), Block.Serialize(Stream)
Extension Methods
ResourceDataExtensions.AsKeyValueCollection(Block)
Constructors
Mesh(BlockType)
Initializes a new instance of the Mesh class.
public Mesh(BlockType type)Parameters
type BlockType
The block type.
Properties
Attachments
Gets the attachments associated with this mesh.
public Dictionary<string, Attachment> Attachments { get; init; }Property Value
Dictionary<string, Attachment>
BoneWeightCount
Gets how many bone weights each vertex carries, or zero when the mesh is not skinned.
public int BoneWeightCount { get; }Property Value
int
Remarks
Read off the vertex buffers rather than the skeleton's own m_nBoneWeightCount. A buffer with blend indices but no weights is skinned to one bone per vertex.
HitboxSets
Gets the hitbox sets associated with this mesh.
public Dictionary<string, Hitbox[]> HitboxSets { get; init; }Property Value
Dictionary<string, Hitbox[]>
MaxBounds
Gets the maximum bounds of the mesh.
public Vector3 MaxBounds { get; }Property Value
MinBounds
Gets the minimum bounds of the mesh.
public Vector3 MinBounds { get; }Property Value
MorphData
Gets or sets the morph data for this mesh.
public Morph? MorphData { get; set; }Property Value
Name
Gets or sets the mesh name.
public string Name { get; set; }Property Value
string
VBIB
Gets or sets the mesh's vertex/index buffer block (VBIB).
public VBIB VBIB { get; set; }Property Value
Methods
GetBounds()
Calculates and sets the bounding box from scene objects.
public void GetBounds()GetMaterialName(KVObject)
Gets the material a draw call renders with, or null when it names none.
public static string? GetMaterialName(KVObject drawCall)Parameters
drawCall KVObject
The draw call to read.
Returns
string?
HasBakedLightingFromLightMap(KVObject)
Determines if the draw call has baked lighting from lightmap.
public static bool HasBakedLightingFromLightMap(KVObject drawCall)Parameters
drawCall KVObject
The draw call data.
Returns
bool
True if baked lighting from lightmap is present.
HasBakedLightingFromVertexStream(KVObject)
Determines if the draw call has baked lighting from vertex stream.
public static bool HasBakedLightingFromVertexStream(KVObject drawCall)Parameters
drawCall KVObject
The draw call data.
Returns
bool
True if baked lighting from vertex stream is present.
IsCompressedNormalTangent(KVObject)
Determines if compressed normal tangent is enabled for the draw call.
public static bool IsCompressedNormalTangent(KVObject drawCall)Parameters
drawCall KVObject
The draw call data.
Returns
bool
True if compressed normal tangent is used.
IsOccluder(KVObject)
Determines if the draw call is an occluder.
public static bool IsOccluder(KVObject drawCall)Parameters
drawCall KVObject
The draw call data.
Returns
bool
True if the draw call is an occluder.
LoadExternalMorphData(IFileLoader)
Loads external morph data from the file loader.
public void LoadExternalMorphData(IFileLoader fileLoader)Parameters
fileLoader IFileLoader
The file loader to use.
Read(BinaryReader)
Reads the block data from a binary reader.
public override void Read(BinaryReader reader)Parameters
reader BinaryReader
The binary reader to read from.
ReleaseVBIB()
Drops the decoded vertex and index buffer data.
public void ReleaseVBIB()
