VRM
VRM is a model file format supported by 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.
Contents
Data blocks
Here are the components of a VRM file, considered in order:
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: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.
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.
Pos
is in world units
- The final three values are optional: they override
<Parent bone>
to define a series of weightmap links.Bone ID
andWeight
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.