Pārlūkot izejas kodu

GLTFExporter: Ensure no empty material arrays.

Mugen87 5 gadi atpakaļ
vecāks
revīzija
0f4602cbea

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

@@ -896,16 +896,16 @@ THREE.GLTFExporter.prototype = {
 
 			}
 
-			if ( ! outputJSON.materials ) {
+			if ( material.isShaderMaterial ) {
 
-				outputJSON.materials = [];
+				console.warn( 'GLTFExporter: THREE.ShaderMaterial not supported.' );
+				return null;
 
 			}
 
-			if ( material.isShaderMaterial && ! material.isGLTFSpecularGlossinessMaterial ) {
+			if ( ! outputJSON.materials ) {
 
-				console.warn( 'GLTFExporter: THREE.ShaderMaterial not supported.' );
-				return null;
+				outputJSON.materials = [];
 
 			}
 

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

@@ -918,16 +918,16 @@ GLTFExporter.prototype = {
 
 			}
 
-			if ( ! outputJSON.materials ) {
+			if ( material.isShaderMaterial ) {
 
-				outputJSON.materials = [];
+				console.warn( 'GLTFExporter: THREE.ShaderMaterial not supported.' );
+				return null;
 
 			}
 
-			if ( material.isShaderMaterial && ! material.isGLTFSpecularGlossinessMaterial ) {
+			if ( ! outputJSON.materials ) {
 
-				console.warn( 'GLTFExporter: THREE.ShaderMaterial not supported.' );
-				return null;
+				outputJSON.materials = [];
 
 			}