Browse Source

Merge pull request #18233 from donmccurdy/bug-gltfexporter-emissive

GLTFExporter: Avoid error on materials without emissive
Mr.doob 5 years ago
parent
commit
056ce4355f
2 changed files with 2 additions and 10 deletions
  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
 				// emissiveFactor
 				var emissive = material.emissive.clone().multiplyScalar( material.emissiveIntensity ).toArray();
 				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
 				// emissiveFactor
 				var emissive = material.emissive.clone().multiplyScalar( material.emissiveIntensity ).toArray();
 				var emissive = material.emissive.clone().multiplyScalar( material.emissiveIntensity ).toArray();