public SimpleSkin(StaticObject staticObject, WGTFile weightFile) { List <uint> staticObjectIndices = staticObject.GetIndices(); List <StaticObjectVertex> staticObjectVertices = staticObject.GetVertices(); int currentVertexOffset = 0; foreach (StaticObjectSubmesh submesh in staticObject.Submeshes) { // Build vertices List <SimpleSkinVertex> vertices = new(staticObjectVertices.Count); for (int i = 0; i < submesh.Vertices.Count; i++) { StaticObjectVertex vertex = submesh.Vertices[i]; WGTWeight weightData = weightFile.Weights[i + currentVertexOffset]; vertices.Add(new SimpleSkinVertex(vertex.Position, weightData.BoneIndices, weightData.Weights, Vector3.Zero, vertex.UV)); } this.Submeshes.Add(new SimpleSkinSubmesh(submesh.Name, submesh.Indices.Select(x => (ushort)x).ToList(), vertices)); currentVertexOffset += submesh.Vertices.Count; } }