Explorar o código

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 %!s(int64=11) %!d(string=hai) anos
pai
achega
304fead08f
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  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;
     }