Merge pull request #1010 from ousttrue/fix/export_divided_test

Fix/export divided test
This commit is contained in:
ousttrue
2021-06-07 20:36:13 +09:00
committed by GitHub
2 changed files with 3 additions and 1 deletions

View File

@@ -44,7 +44,9 @@ namespace UniGLTF
var positionAccessorIndex = -1;
if (sparseIndices.Length > 0)
{
#if VRM_DEVELOP
Debug.LogFormat("Sparse {0}/{1}", sparseIndices.Length, positions.Length);
#endif
var sparseIndicesViewIndex = gltf.ExtendBufferAndGetViewIndex(gltfBuffer, sparseIndices);
positionAccessorIndex = gltf.ExtendSparseBufferAndGetAccessorIndex(gltfBuffer, accessorCount, positions, sparseIndices, sparseIndicesViewIndex, glBufferTarget.NONE);
}

View File

@@ -89,7 +89,7 @@ namespace UniGLTF
// blendShape(morph target)
for (int j = 0; j < mesh.blendShapeCount; ++j)
{
var blendShape = new MeshExportUtil.BlendShapeBuffer(indices.Length);
var blendShape = new MeshExportUtil.BlendShapeBuffer(usedIndices.Count);
// aggriage morph target
mesh.GetBlendShapeFrameVertices(j, 0, blendShapePositions, blendShapeNormals, null);