Browse Source

GLTFExporter: add parseAsync (#22755)

* GLTFExporter: add parseAsync

* Update examples/jsm/exporters/GLTFExporter.js

Co-authored-by: Don McCurdy <[email protected]>

* Update examples/jsm/exporters/GLTFExporter.js

Co-authored-by: Don McCurdy <[email protected]>

Co-authored-by: Don McCurdy <[email protected]>
Marco Fugaro 3 years ago
parent
commit
b884bfeae2
1 changed files with 20 additions and 0 deletions
  1. 20 0
      examples/jsm/exporters/GLTFExporter.js

+ 20 - 0
examples/jsm/exporters/GLTFExporter.js

@@ -106,6 +106,26 @@ class GLTFExporter {
 
 
 	}
 	}
 
 
+	parseAsync( input, options ) {
+
+		const scope = this;
+
+		return new Promise( function ( resolve, reject ) {
+
+		try {
+
+			scope.parse( input, resolve, options );
+
+		} catch ( e ) {
+
+			reject( e );
+
+		}
+
+		} );
+
+	}
+
 }
 }
 
 
 //------------------------------------------------------------------------------
 //------------------------------------------------------------------------------