Table of Contents

Class Model

Namespace
ValveResourceFormat.ResourceTypes
Assembly
ValveResourceFormat.dll

Represents a model resource containing meshes, skeleton, and animations.

public class Model : KeyValuesOrNTRO

Inheritance

Inherited Members

Extension Methods

Properties

Attachments

Gets the attachments for this model.

public Dictionary<string, Attachment> Attachments { get; }

Property Value

Dictionary<string, Attachment>

FlexControllers

Gets the flex controllers for this model.

public FlexController[] FlexControllers { get; }

Property Value

FlexController[]

HitboxSets

Gets the hitbox sets for this model.

public Dictionary<string, Hitbox[]> HitboxSets { get; }

Property Value

Dictionary<string, Hitbox[]>

KeyValues

Gets the key-values data from the model info.

public KVObject KeyValues { get; }

Property Value

KVObject

Name

Gets the model name.

public string Name { get; }

Property Value

string

Skeleton

Gets the skeleton for this model.

public Skeleton Skeleton { get; }

Property Value

Skeleton

Methods

GetAllAnimations(IFileLoader)

Gets all animations from this model including embedded, referenced, and animation groups.

public IEnumerable<Animation> GetAllAnimations(IFileLoader fileLoader)

Parameters

fileLoader IFileLoader

The file loader to use.

Returns

IEnumerable<Animation>

Enumerable of all animations.

GetDefaultMeshGroups()

Gets the default mesh groups based on the default mesh group mask.

public IEnumerable<string> GetDefaultMeshGroups()

Returns

IEnumerable<string>

Enumerable of default mesh group names.

GetEmbeddedAnimations()

Gets embedded animations from the model.

public IEnumerable<Animation> GetEmbeddedAnimations()

Returns

IEnumerable<Animation>

Enumerable of animations.

GetEmbeddedMeshes()

Gets embedded meshes from the model.

public IEnumerable<(Mesh Mesh, int MeshIndex, string Name)> GetEmbeddedMeshes()

Returns

IEnumerable<(Mesh Mesh, int MeshIndex, string Name)>

Enumerable of mesh, mesh index, and name tuples.

GetEmbeddedMeshesAndLoD()

Gets embedded meshes with their LoD masks.

public IEnumerable<(Mesh Mesh, int MeshIndex, string Name, long LoDMask)> GetEmbeddedMeshesAndLoD()

Returns

IEnumerable<(Mesh Mesh, int MeshIndex, string Name, long LoDMask)>

Enumerable of mesh, mesh index, name, and LoD mask tuples.

GetEmbeddedPhys()

Gets embedded physics data from the model.

public PhysAggregateData GetEmbeddedPhys()

Returns

PhysAggregateData

The physics aggregate data, or null if not present.

GetMaterialGroups()

Gets the material groups defined in the model.

public IEnumerable<(string Name, string[] Materials)> GetMaterialGroups()

Returns

IEnumerable<(string Name, string[] Materials)>

Enumerable of material group names and their materials.

GetMeshGroups()

Gets the mesh groups defined in the model.

public IEnumerable<string> GetMeshGroups()

Returns

IEnumerable<string>

Enumerable of mesh group names.

GetReferenceMeshNamesAndLoD()

Gets referenced mesh names and their LoD masks.

public IEnumerable<(int MeshIndex, string MeshName, long LoDMask)> GetReferenceMeshNamesAndLoD()

Returns

IEnumerable<(int MeshIndex, string MeshName, long LoDMask)>

Enumerable of mesh index, mesh name, and LoD mask tuples.

GetReferencedAnimationGroupNames()

Gets referenced animation group names.

public IEnumerable<string> GetReferencedAnimationGroupNames()

Returns

IEnumerable<string>

Enumerable of animation group names.

GetReferencedAnimations(IFileLoader)

Gets animations referenced from other models.

public IEnumerable<Animation> GetReferencedAnimations(IFileLoader fileLoader)

Parameters

fileLoader IFileLoader

The file loader to use.

Returns

IEnumerable<Animation>

Enumerable of animations.

GetReferencedPhysNames()

Gets referenced physics data names.

public IEnumerable<string> GetReferencedPhysNames()

Returns

IEnumerable<string>

Enumerable of physics data names.

GetRemapTable(int)

Get the bone remap table of a specific mesh. This is used to remap bone indices in the mesh VBIB to bone indices of the model skeleton.

public int[] GetRemapTable(int meshIndex)

Parameters

meshIndex int

Returns

int[]

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.

SetExternalMeshData(Mesh)

Populates cached mesh-related data (flex controllers, hitboxes, attachments) from an external mesh resource.

public void SetExternalMeshData(Mesh mesh)

Parameters

mesh Mesh

The mesh providing supplemental data.

SetExternalMorphData(Morph)

Populates cached flex controller data from an externally loaded morph resource.

public void SetExternalMorphData(Morph morph)

Parameters

morph Morph

The morph data whose flex controllers should be reused.