Explorar el Código

Editor: Added support for usda files.

Mr.doob hace 6 meses
padre
commit
5737a9b96c
Se han modificado 1 ficheros con 22 adiciones y 0 borrados
  1. 22 0
      editor/js/Loader.js

+ 22 - 0
editor/js/Loader.js

@@ -622,6 +622,28 @@ function Loader( editor ) {
 
 			}
 
+			case 'usda':
+
+			{
+
+				reader.addEventListener( 'load', async function ( event ) {
+
+					const contents = event.target.result;
+
+					const { USDZLoader } = await import( 'three/addons/loaders/USDZLoader.js' );
+
+					const group = new USDZLoader().parse( contents );
+					group.name = filename;
+
+					editor.execute( new AddObjectCommand( editor, group ) );
+
+				}, false );
+				reader.readAsText( file );
+
+				break;
+
+			}
+
 			case 'usdz':
 
 			{

粤ICP备19079148号