Skip to content

Commit

Permalink
Merge pull request #367 from FrankGalligan/fix_morph_targets
Browse files Browse the repository at this point in the history
If primitive contains targets set sequential encoding
  • Loading branch information
lilleyse authored May 1, 2018
2 parents dc84a54 + d1de0ba commit a0e8d89
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/compressDracoMeshes.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,11 @@ function compressDracoMeshes(gltf, options) {
encoder.SetAttributeQuantization(encoderModule.GENERIC, skinQuantization);
}

if (defined(primitive.targets)) {
// Set sequential encoding to preserve order of vertices.
encoder.SetEncodingMethod(encoderModule.MESH_SEQUENTIAL_ENCODING);
}

var encodedLength = encoder.EncodeMeshToDracoBuffer(newMesh, encodedDracoDataArray);
if (encodedLength <= 0) {
throw new DeveloperError('Error: Encoding failed.');
Expand Down

0 comments on commit a0e8d89

Please sign in to comment.