Browse Source

Set Vertex hasWeights when loadBlendData is called

Mesh class assumes all vertices have the same size. On the other hand,
FBX format ignores blend weights and indices when they're zero. This
causes less data written to the output stream than it was indicated
beforehand and the resulting GPB bundle is corrupt.

Fixes #1613
Üstün Ergenoglu 11 years ago
parent
commit
304fead08f
1 changed files with 1 additions and 1 deletions
  1. 1 1
      tools/encoder/src/FBXUtil.cpp

+ 1 - 1
tools/encoder/src/FBXUtil.cpp

@@ -395,10 +395,10 @@ void loadVertexColor(FbxMesh* fbxMesh, int vertexIndex, int controlPointIndex, V
 void loadBlendData(const vector<Vector2>& vertexWeights, Vertex* vertex)
 {
     size_t size = vertexWeights.size();
+    vertex->hasWeights= true;
 
     if (size >= 1)
     {
-        vertex->hasWeights= true;
         vertex->blendIndices.x = vertexWeights[0].x;
         vertex->blendWeights.x = vertexWeights[0].y;
     }