Browse Source

Merge pull request #12859 from donmccurdy/feat-gltfexporter-no-index-bytestride

GLTFExporter: Only define byteStride for vertex attributes.
Mr.doob 7 years ago
parent
commit
ba4a5d3a8a
1 changed files with 8 additions and 2 deletions
  1. 8 2
      examples/js/exporters/GLTFExporter.js

+ 8 - 2
examples/js/exporters/GLTFExporter.js

@@ -271,13 +271,19 @@ THREE.GLTFExporter.prototype = {
 
 				buffer: processBuffer( data, componentType, start, count ),
 				byteOffset: byteOffset,
-				byteLength: byteLength,
-				byteStride: data.itemSize * componentSize
+				byteLength: byteLength
 
 			};
 
 			if ( target !== undefined ) gltfBufferView.target = target;
 
+			if ( target === WEBGL_CONSTANTS.ARRAY_BUFFER ) {
+
+				// Only define byteStride for vertex attributes.
+				gltfBufferView.byteStride = data.itemSize * componentSize;
+
+			}
+
 			byteOffset += byteLength;
 
 			outputJSON.bufferViews.push( gltfBufferView );