瀏覽代碼

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 年之前
父節點
當前提交
304fead08f
共有 1 個文件被更改,包括 1 次插入1 次删除
  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;
     }