VRM

From Valve Developer Community
Jump to navigation Jump to search

Stub

This article or section is a stub. You can help by expanding it.

VRM is a model file format supported by Source StudioMDL. It was developed as a successor to SMD, but ultimately was scrapped in favor of sticking with SMD, and later DMX. The main distinction between the formats is that VRM supports multiple LoDs in a single file, using Intel's proprietary Multi-Resolution Mesh (MRM) technology.

Warning.pngRisk of Confusion:The VRM file extension is also used for an unrelated VR model format.

Data blocks

Here are the components of a VRM file, considered in order:

Note.pngNote:This document has been written assuming you already know how an SMD file works.
Warning.pngWarning:This document does NOT (at the moment) detail ANY info on how VRM implements MRM.

Header

version 2
name "<string|Object Name>"
vertices <int|Amount of vertices>
faces <int|Amount of faces>
materials <int|Amount of materials>
texcoords <int|Amount of texture coordinates>
normals <int|Amount of normals>
tristrips <int|Amount of tristrips>

Name

Defines the name for the object, this is ignored by StudioMDL.

Vertices

Defines the amount of vertices used in the mesh.

Faces

Defines the amount of faces (triangles) used in the mesh.

Materials

Defines the amount of materials (textures) used in the mesh.

Texcoords

Defines the amount of texture coordinates (UVs) used in the mesh.

Warning.pngWarning:This value has to be above 0, as otherwise StudioMDL will crash with an error.

Normals

Defines the amount of normals used in the mesh.

Tristrips

Always 0.

Note.pngNote:StudioMDL ignores this, so you *could* use any value you want.

Nodes

Works exactly the same as in SMD.

Skeleton

Works exactly the same as in SMD.

Vertexlist

List of vertices.

Syntax

vertexlist
Begins the block.
<int|Vertex ID> <int|Parent bone> <float|PosX PosY PosZ> <int|Links> <int|Bone ID> <float|Weight> [...]
Defines a vertex.
The final three values are optional: they override <Parent bone> to define a series of weightmap links. Bone ID and Weight are repeated for each link. If the weights do not add up to 1, any remaining value is placed on <Parent bone>.
end
Ends the block.

Facelist

List of faces (triangles).

Syntax

facelist
Begins the block.
<int|Face ID> <int|VertID1 VertID2 VertID3>
Defines a triangle.
end
Ends the block.

Materiallist

List of materials.

Syntax

materiallist
Begins the block.
<int|Material ID> <float|ARed AGreen ABlue AAlpha> <float|DRed DGreen DBlue DAlpha> <float|SRed SGreen SBlue SAlpha> "<string|Texture Path>"
Defines a material.
end
Ends the block.

Texcoordlist

List of texture coordinates (UVs).

Syntax

facelist
Begins the block.
<int|Texture coordinate ID> <float|U V>
Defines a texture coordinate.
end
Ends the block.

Normallist

List of normals (normal vectors).

Syntax

normallist
Begins the block.
<int|ID> <int|Bone ID> <float|NormX NormY NormZ>
Defines a normal.
end
Ends the block.

Faceattriblist

List of faces, again, but now with extra attributes.

Syntax

facelist
Begins the block.
<int|Face ID> <int|Material ID> <int|Smooth> <int|TexCoordID1 TexCoordID2 TexCoordID3> <int|NormID1 NormID2 NormID3>
Defines attributes for a face.
end
Ends the block.

External links