浏览代码

GLTFExporter: change -1 for null when returning empty elements

Fernando Serrano 7 年之前
父节点
当前提交
071db5420b
共有 1 个文件被更改,包括 4 次插入4 次删除
  1. 4 4
      examples/js/exporters/GLTFExporter.js

+ 4 - 4
examples/js/exporters/GLTFExporter.js

@@ -481,7 +481,7 @@ THREE.GLTFExporter.prototype = {
 			// Skip creating an accessor if the attribute doesn't have data to export
 			if ( count === 0) {
 
-				return -1;
+				return null;
 
 			}
 
@@ -965,7 +965,7 @@ THREE.GLTFExporter.prototype = {
 				if ( attributeName.substr( 0, 5 ) !== 'MORPH' ) {
 					
 					var accessor = processAccessor( attribute, geometry );
-					if ( accessor !== -1 ) {
+					if ( accessor !== null ) {
 
 						attributes[ attributeName ] = accessor;
 
@@ -1132,7 +1132,7 @@ THREE.GLTFExporter.prototype = {
 
 			if ( primitives.length === 0 ) {
 
-				return -1;
+				return null;
 
 			}
 
@@ -1445,7 +1445,7 @@ THREE.GLTFExporter.prototype = {
 
 				var mesh = processMesh( object );
 
-				if ( mesh !== -1 ) {
+				if ( mesh !== null ) {
 
 					gltfNode.mesh = mesh;