浏览代码

GLTFExporter: Avoid error on materials without emissive

Don McCurdy 5 年之前
父节点
当前提交
4059f232c5
共有 2 个文件被更改,包括 2 次插入10 次删除
  1. 1 5
      examples/js/exporters/GLTFExporter.js
  2. 1 5
      examples/jsm/exporters/GLTFExporter.js

+ 1 - 5
examples/js/exporters/GLTFExporter.js

@@ -1019,11 +1019,7 @@ THREE.GLTFExporter.prototype = {
 
 			}
 
-			if ( material.isMeshBasicMaterial ||
-				material.isLineBasicMaterial ||
-				material.isPointsMaterial ) {
-
-			} else {
+			if ( material.emissive ) {
 
 				// emissiveFactor
 				var emissive = material.emissive.clone().multiplyScalar( material.emissiveIntensity ).toArray();

+ 1 - 5
examples/jsm/exporters/GLTFExporter.js

@@ -1041,11 +1041,7 @@ GLTFExporter.prototype = {
 
 			}
 
-			if ( material.isMeshBasicMaterial ||
-				material.isLineBasicMaterial ||
-				material.isPointsMaterial ) {
-
-			} else {
+			if ( material.emissive ) {
 
 				// emissiveFactor
 				var emissive = material.emissive.clone().multiplyScalar( material.emissiveIntensity ).toArray();