Skip to content

Commit d91ca92

Browse files
committed
Vertex and skin count mismatch (part 2)
1 parent b6e4422 commit d91ca92

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/MillionDance/Core/PmxCreator.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ public PmxModel CreateFrom([NotNull] Avatar combinedAvatar, [NotNull] Mesh combi
7676
private static IReadOnlyList<PmxVertex> AddVertices([NotNull] Avatar combinedAvatar, [NotNull] Mesh combinedMesh, int bodyMeshVertexCount) {
7777
var vertexCount = combinedMesh.VertexCount;
7878
var vertices = new PmxVertex[vertexCount];
79+
// In case that vertex count is more than skin count (ill-formed MLTD models: ch_ex005_022ser)
7980
var skinCount = combinedMesh.Skin.Count;
8081

8182
for (var i = 0; i < vertexCount; ++i) {
@@ -114,6 +115,7 @@ private static IReadOnlyList<PmxVertex> AddVertices([NotNull] Avatar combinedAva
114115

115116
switch (affectiveInfluenceCount) {
116117
case 0:
118+
// This vertex is static. It is not attached to any bone.
117119
break;
118120
case 1:
119121
vertex.Deformation = Deformation.Bdef1;

0 commit comments

Comments
 (0)