Browse Source

GLTFExporter: Ensure no empty material arrays.

Mugen87 5 years ago
parent
commit
0f4602cbea
2 changed files with 10 additions and 10 deletions
  1. 5 5
      examples/js/exporters/GLTFExporter.js
  2. 5 5
      examples/jsm/exporters/GLTFExporter.js

+ 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 = [];
 
 
 			}
 			}