Class Model
Namespace: ValveResourceFormat.ResourceTypes
Assembly: ValveResourceFormat.dll
Represents a model resource containing meshes, skeleton, and animations.
public class Model : KeyValuesOrNTROInheritance
object ← Block ← KeyValuesOrNTRO ← Model
Inherited Members
KeyValuesOrNTRO.Type, KeyValuesOrNTRO.Data, 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)
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
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.
[NotNull]
public KVObject KeyValues { get; }Property Value
Name
Gets the model name.
public string Name { get; }Property Value
Skeleton
Gets the skeleton for this model.
public Skeleton Skeleton { get; }Property Value
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
Enumerable of all animations.
GetDefaultMeshGroups()
Gets the default mesh groups based on the default mesh group mask.
public IEnumerable<string> GetDefaultMeshGroups()Returns
Enumerable of default mesh group names.
GetEmbeddedAnimations()
Gets embedded animations from the model.
public IEnumerable<Animation> GetEmbeddedAnimations()Returns
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
The physics aggregate data, or null if not present.
GetFaceposerFolders()
Gets the faceposer folders mapping animation names to folder names.
public Dictionary<string, string> GetFaceposerFolders()Returns
Dictionary mapping animation names to their folder names, or empty dictionary if no folders exist.
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
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
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
Enumerable of animations.
GetReferencedPhysNames()
Gets referenced physics data names.
public IEnumerable<string> GetReferencedPhysNames()Returns
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.

