Browse Source

no hardcoded list (#28364)

ycw 1 year ago
parent
commit
a08c2edf72
1 changed files with 2 additions and 1 deletions
  1. 2 1
      editor/js/Menubar.File.js

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

@@ -1,4 +1,5 @@
 import { UIPanel, UIRow, UIHorizontalRule } from './libs/ui.js';
+import { Loader } from './Loader.js';
 
 function MenubarFile( editor ) {
 
@@ -111,7 +112,7 @@ function MenubarFile( editor ) {
 	const fileInput = document.createElement( 'input' );
 	fileInput.multiple = true;
 	fileInput.type = 'file';
-	fileInput.accept = '.3dm, .3ds, .3mf, .amf, .dae, .drc, .fbx, .glb, .gltf, .js, .json, .kmz, .ldr, .md2, .mpd, .obj, .pcd, .ply, .stl, .svg, .usdz, .vox, .vtk, .vtp, .wrl, .xyz, .zip';
+	fileInput.accept = Loader.getSupportedFileFormats().map( format => '.' + format ).join( ', ' );
 	fileInput.addEventListener( 'change', function () {
 
 		editor.loader.loadFiles( fileInput.files );