소스 검색

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

GLTFExporter: Avoid error on materials without emissive
Mr.doob 5 년 전
부모
커밋
056ce4355f
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();