Forráskód Böngészése

Exporters: Clean up.

Don McCurdy 6 éve
szülő
commit
6fe3e4256c

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

@@ -1930,7 +1930,7 @@ GLTFExporter.prototype = {
 
 			for ( var i = 0; i < input.length; i ++ ) {
 
-				if ( input[ i ] instanceof Scene ) {
+				if ( input[ i ].isScene ) {
 
 					processScene( input[ i ] );
 

+ 6 - 6
examples/jsm/exporters/OBJExporter.js

@@ -42,13 +42,13 @@ OBJExporter.prototype = {
 
 			var normalMatrixWorld = new Matrix3();
 
-			if ( geometry instanceof Geometry ) {
+			if ( geometry.isGeometry ) {
 
 				geometry = new BufferGeometry().setFromObject( mesh );
 
 			}
 
-			if ( geometry instanceof BufferGeometry ) {
+			if ( geometry.isBufferGeometry ) {
 
 				// shortcuts
 				var vertices = geometry.getAttribute( 'position' );
@@ -182,13 +182,13 @@ OBJExporter.prototype = {
 			var geometry = line.geometry;
 			var type = line.type;
 
-			if ( geometry instanceof Geometry ) {
+			if ( geometry.isGeometry ) {
 
 				geometry = new BufferGeometry().setFromObject( line );
 
 			}
 
-			if ( geometry instanceof BufferGeometry ) {
+			if ( geometry.isBufferGeometry ) {
 
 				// shortcuts
 				var vertices = geometry.getAttribute( 'position' );
@@ -251,13 +251,13 @@ OBJExporter.prototype = {
 
 		object.traverse( function ( child ) {
 
-			if ( child instanceof Mesh ) {
+			if ( child.isMesh ) {
 
 				parseMesh( child );
 
 			}
 
-			if ( child instanceof Line ) {
+			if ( child.isLine ) {
 
 				parseLine( child );