Skip to content

Commit

Permalink
GLTFExporter: Add early exit if attributes not found in processMesh
Browse files Browse the repository at this point in the history
  • Loading branch information
fernandojsg committed Mar 25, 2018
1 parent 214435b commit bbf74b9
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions examples/js/exporters/GLTFExporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -975,6 +975,13 @@ THREE.GLTFExporter.prototype = {

}

// Skip if no exportable attributes found
if ( Object.keys( attributes ).length === 0 ) {

return null;

}

// Morph targets
if ( mesh.morphTargetInfluences !== undefined && mesh.morphTargetInfluences.length > 0 ) {

Expand Down Expand Up @@ -1107,21 +1114,16 @@ THREE.GLTFExporter.prototype = {

}

// Skip meshes without exportable attributes
if ( Object.keys( primitive.attributes ).length > 0 ) {
var material = processMaterial( materials[ groups[ i ].materialIndex ] );

var material = processMaterial( materials[ groups[ i ].materialIndex ] );
if ( material !== null ) {

if ( material !== null ) {

primitive.material = material;

}

primitives.push( primitive );
primitive.material = material;

}

primitives.push( primitive );

}

if ( didForceIndices ) {
Expand Down

0 comments on commit bbf74b9

Please sign in to comment.