瀏覽代碼

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 年之前
父節點
當前提交
b884bfeae2
共有 1 個文件被更改,包括 20 次插入0 次删除
  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 );
+
+		}
+
+		} );
+
+	}
+
 }
 
 //------------------------------------------------------------------------------