浏览代码

USDZExporter: Rename parse to parseAsync (#28049)

USDZExporter: Add parse method
Examples: Update misc_exporter_usdz
Editor: Replace USDZExporter.parse with parseAsync
MJurczyk 1 年之前
父节点
当前提交
49d26cc571
共有 3 个文件被更改,包括 9 次插入3 次删除
  1. 1 1
      editor/js/Menubar.File.js
  2. 7 1
      examples/jsm/exporters/USDZExporter.js
  3. 1 1
      examples/misc_exporter_usdz.html

+ 1 - 1
editor/js/Menubar.File.js

@@ -278,7 +278,7 @@ function MenubarFile( editor ) {
 
 
 		const exporter = new USDZExporter();
 		const exporter = new USDZExporter();
 
 
-		saveArrayBuffer( await exporter.parse( editor.scene ), 'model.usdz' );
+		saveArrayBuffer( await exporter.parseAsync( editor.scene ), 'model.usdz' );
 
 
 	} );
 	} );
 	options.add( option );
 	options.add( option );

+ 7 - 1
examples/jsm/exporters/USDZExporter.js

@@ -12,7 +12,13 @@ import { decompress } from './../utils/TextureUtils.js';
 
 
 class USDZExporter {
 class USDZExporter {
 
 
-	async parse( scene, options = {} ) {
+	parse( scene, onDone, onError, options ) {
+
+		this.parseAsync( scene, options ).then( onDone ).catch( onError );
+
+	}
+
+	async parseAsync( scene, options = {} ) {
 
 
 		options = Object.assign( {
 		options = Object.assign( {
 			ar: {
 			ar: {

+ 1 - 1
examples/misc_exporter_usdz.html

@@ -97,7 +97,7 @@
 					// USDZ
 					// USDZ
 
 
 					const exporter = new USDZExporter();
 					const exporter = new USDZExporter();
-					const arraybuffer = await exporter.parse( gltf.scene );
+					const arraybuffer = await exporter.parseAsync( gltf.scene );
 					const blob = new Blob( [ arraybuffer ], { type: 'application/octet-stream' } );
 					const blob = new Blob( [ arraybuffer ], { type: 'application/octet-stream' } );
 
 
 					const link = document.getElementById( 'link' );
 					const link = document.getElementById( 'link' );