Skip to content

Commit

Permalink
Editor: Simplified File/Export.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdoob committed May 7, 2024
1 parent 9f81b72 commit cc9a249
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 53 deletions.
29 changes: 12 additions & 17 deletions editor/js/Menubar.File.js
Expand Up @@ -66,12 +66,7 @@ function MenubarFile( editor ) {
} );
options.add( option );

//

options.add( new UIHorizontalRule() );


// Export (submenu)
// Export

const fileExportSubmenuTitle = new UIRow().setTextContent( strings.getKey( 'menubar/file/export' ) ).addClass( 'option' ).addClass( 'submenu-title' );
fileExportSubmenuTitle.onMouseOver( function () {
Expand All @@ -97,7 +92,7 @@ function MenubarFile( editor ) {

option = new UIRow();
option.setClass( 'option' );
option.setTextContent( strings.getKey( 'menubar/file/export/drc' ) );
option.setTextContent( 'DRC' );
option.onClick( async function () {

const object = editor.selected;
Expand Down Expand Up @@ -134,7 +129,7 @@ function MenubarFile( editor ) {

option = new UIRow();
option.setClass( 'option' );
option.setTextContent( strings.getKey( 'menubar/file/export/glb' ) );
option.setTextContent( 'GLB' );
option.onClick( async function () {

const scene = editor.scene;
Expand Down Expand Up @@ -165,7 +160,7 @@ function MenubarFile( editor ) {

option = new UIRow();
option.setClass( 'option' );
option.setTextContent( strings.getKey( 'menubar/file/export/gltf' ) );
option.setTextContent( 'GLTF' );
option.onClick( async function () {

const scene = editor.scene;
Expand Down Expand Up @@ -197,7 +192,7 @@ function MenubarFile( editor ) {

option = new UIRow();
option.setClass( 'option' );
option.setTextContent( strings.getKey( 'menubar/file/export/obj' ) );
option.setTextContent( 'OBJ' );
option.onClick( async function () {

const object = editor.selected;
Expand All @@ -222,7 +217,7 @@ function MenubarFile( editor ) {

option = new UIRow();
option.setClass( 'option' );
option.setTextContent( strings.getKey( 'menubar/file/export/ply' ) );
option.setTextContent( 'PLY' );
option.onClick( async function () {

const { PLYExporter } = await import( 'three/addons/exporters/PLYExporter.js' );
Expand All @@ -238,11 +233,11 @@ function MenubarFile( editor ) {
} );
fileExportSubmenu.add( option );

// Export PLY (Binary)
// Export PLY (BINARY)

option = new UIRow();
option.setClass( 'option' );
option.setTextContent( strings.getKey( 'menubar/file/export/ply_binary' ) );
option.setTextContent( 'PLY (BINARY)' );
option.onClick( async function () {

const { PLYExporter } = await import( 'three/addons/exporters/PLYExporter.js' );
Expand All @@ -262,7 +257,7 @@ function MenubarFile( editor ) {

option = new UIRow();
option.setClass( 'option' );
option.setTextContent( strings.getKey( 'menubar/file/export/stl' ) );
option.setTextContent( 'STL' );
option.onClick( async function () {

const { STLExporter } = await import( 'three/addons/exporters/STLExporter.js' );
Expand All @@ -274,11 +269,11 @@ function MenubarFile( editor ) {
} );
fileExportSubmenu.add( option );

// Export STL (Binary)
// Export STL (BINARY)

option = new UIRow();
option.setClass( 'option' );
option.setTextContent( strings.getKey( 'menubar/file/export/stl_binary' ) );
option.setTextContent( 'STL (BINARY)' );
option.onClick( async function () {

const { STLExporter } = await import( 'three/addons/exporters/STLExporter.js' );
Expand All @@ -294,7 +289,7 @@ function MenubarFile( editor ) {

option = new UIRow();
option.setClass( 'option' );
option.setTextContent( strings.getKey( 'menubar/file/export/usdz' ) );
option.setTextContent( 'USDZ' );
option.onClick( async function () {

const { USDZExporter } = await import( 'three/addons/exporters/USDZExporter.js' );
Expand Down
36 changes: 0 additions & 36 deletions editor/js/Strings.js
Expand Up @@ -41,15 +41,6 @@ function Strings( config ) {
'menubar/file/new': 'New',
'menubar/file/import': 'Import',
'menubar/file/export': 'Export',
'menubar/file/export/drc': 'Export DRC',
'menubar/file/export/glb': 'Export GLB',
'menubar/file/export/gltf': 'Export GLTF',
'menubar/file/export/obj': 'Export OBJ',
'menubar/file/export/ply': 'Export PLY',
'menubar/file/export/ply_binary': 'Export PLY (Binary)',
'menubar/file/export/stl': 'Export STL',
'menubar/file/export/stl_binary': 'Export STL (Binary)',
'menubar/file/export/usdz': 'Export USDZ',

'menubar/edit': 'Edit',
'menubar/edit/undo': 'Undo (Ctrl+Z)',
Expand Down Expand Up @@ -430,15 +421,6 @@ function Strings( config ) {
'menubar/file/new': 'Nouveau',
'menubar/file/import': 'Importer',
'menubar/file/export': 'Exporter',
'menubar/file/export/drc': 'Exporter DRC',
'menubar/file/export/glb': 'Exporter GLB',
'menubar/file/export/gltf': 'Exporter GLTF',
'menubar/file/export/obj': 'Exporter OBJ',
'menubar/file/export/ply': 'Exporer PLY',
'menubar/file/export/ply_binary': 'Exporter PLY (Binaire)',
'menubar/file/export/stl': 'Exporter STL',
'menubar/file/export/stl_binary': 'Exporter STL (Binaire)',
'menubar/file/export/usdz': 'Exporter USDZ',

'menubar/edit': 'Edition',
'menubar/edit/undo': 'Annuler (Ctrl+Z)',
Expand Down Expand Up @@ -819,15 +801,6 @@ function Strings( config ) {
'menubar/file/new': '新建',
'menubar/file/import': '导入',
'menubar/file/export': '导出',
'menubar/file/export/drc': '导出DRC',
'menubar/file/export/glb': '导出GLB',
'menubar/file/export/gltf': '导出GLTF',
'menubar/file/export/obj': '导出OBJ',
'menubar/file/export/ply': '导出PLY',
'menubar/file/export/ply_binary': '导出PLY(二进制)',
'menubar/file/export/stl': '导出STL',
'menubar/file/export/stl_binary': '导出STL(二进制)',
'menubar/file/export/usdz': '导出USDZ',

'menubar/edit': '编辑',
'menubar/edit/undo': '撤销 (Ctrl+Z)',
Expand Down Expand Up @@ -1208,15 +1181,6 @@ function Strings( config ) {
'menubar/file/new': '新規',
'menubar/file/import': 'インポート',
'menubar/file/export': 'エクスポート',
'menubar/file/export/drc': 'エクスポート DRC',
'menubar/file/export/glb': 'エクスポート GLB',
'menubar/file/export/gltf': 'エクスポート GLTF',
'menubar/file/export/obj': 'エクスポート OBJ',
'menubar/file/export/ply': 'エクスポート PLY',
'menubar/file/export/ply_binary': 'エクスポート PLY(バイナリ)',
'menubar/file/export/stl': 'エクスポート STL',
'menubar/file/export/stl_binary': 'エクスポート STL(バイナリ)',
'menubar/file/export/usdz': 'エクスポート USDZ',

'menubar/edit': '編集',
'menubar/edit/undo': '元に戻す(Ctrl+Z)',
Expand Down

0 comments on commit cc9a249

Please sign in to comment.