|
@@ -1,12 +1,5 @@
|
|
import * as THREE from '../../build/three.module.js';
|
|
import * as THREE from '../../build/three.module.js';
|
|
|
|
|
|
-import { ColladaExporter } from '../../examples/jsm/exporters/ColladaExporter.js';
|
|
|
|
-import { DRACOExporter } from '../../examples/jsm/exporters/DRACOExporter.js';
|
|
|
|
-import { GLTFExporter } from '../../examples/jsm/exporters/GLTFExporter.js';
|
|
|
|
-import { OBJExporter } from '../../examples/jsm/exporters/OBJExporter.js';
|
|
|
|
-import { PLYExporter } from '../../examples/jsm/exporters/PLYExporter.js';
|
|
|
|
-import { STLExporter } from '../../examples/jsm/exporters/STLExporter.js';
|
|
|
|
-
|
|
|
|
import { JSZip } from '../../examples/jsm/libs/jszip.module.min.js';
|
|
import { JSZip } from '../../examples/jsm/libs/jszip.module.min.js';
|
|
|
|
|
|
import { UIPanel, UIRow, UIHorizontalRule } from './libs/ui.js';
|
|
import { UIPanel, UIRow, UIHorizontalRule } from './libs/ui.js';
|
|
@@ -200,7 +193,9 @@ function MenubarFile( editor ) {
|
|
var option = new UIRow();
|
|
var option = new UIRow();
|
|
option.setClass( 'option' );
|
|
option.setClass( 'option' );
|
|
option.setTextContent( strings.getKey( 'menubar/file/export/dae' ) );
|
|
option.setTextContent( strings.getKey( 'menubar/file/export/dae' ) );
|
|
- option.onClick( function () {
|
|
|
|
|
|
+ option.onClick( async function () {
|
|
|
|
+
|
|
|
|
+ var { ColladaExporter } = await import( '../../examples/jsm/exporters/ColladaExporter.js' );
|
|
|
|
|
|
var exporter = new ColladaExporter();
|
|
var exporter = new ColladaExporter();
|
|
|
|
|
|
@@ -218,7 +213,7 @@ function MenubarFile( editor ) {
|
|
var option = new UIRow();
|
|
var option = new UIRow();
|
|
option.setClass( 'option' );
|
|
option.setClass( 'option' );
|
|
option.setTextContent( strings.getKey( 'menubar/file/export/drc' ) );
|
|
option.setTextContent( strings.getKey( 'menubar/file/export/drc' ) );
|
|
- option.onClick( function () {
|
|
|
|
|
|
+ option.onClick( async function () {
|
|
|
|
|
|
var object = editor.selected;
|
|
var object = editor.selected;
|
|
|
|
|
|
@@ -229,6 +224,8 @@ function MenubarFile( editor ) {
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ var { DRACOExporter } = await import( '../../examples/jsm/exporters/DRACOExporter.js' );
|
|
|
|
+
|
|
var exporter = new DRACOExporter();
|
|
var exporter = new DRACOExporter();
|
|
|
|
|
|
// TODO: Change to DRACOExporter's parse( geometry, onParse )?
|
|
// TODO: Change to DRACOExporter's parse( geometry, onParse )?
|
|
@@ -243,11 +240,13 @@ function MenubarFile( editor ) {
|
|
var option = new UIRow();
|
|
var option = new UIRow();
|
|
option.setClass( 'option' );
|
|
option.setClass( 'option' );
|
|
option.setTextContent( strings.getKey( 'menubar/file/export/glb' ) );
|
|
option.setTextContent( strings.getKey( 'menubar/file/export/glb' ) );
|
|
- option.onClick( function () {
|
|
|
|
|
|
+ option.onClick( async function () {
|
|
|
|
|
|
var scene = editor.scene;
|
|
var scene = editor.scene;
|
|
var animations = getAnimations( scene );
|
|
var animations = getAnimations( scene );
|
|
|
|
|
|
|
|
+ var { GLTFExporter } = await import( '../../examples/jsm/exporters/GLTFExporter.js' );
|
|
|
|
+
|
|
var exporter = new GLTFExporter();
|
|
var exporter = new GLTFExporter();
|
|
|
|
|
|
exporter.parse( scene, function ( result ) {
|
|
exporter.parse( scene, function ( result ) {
|
|
@@ -264,11 +263,13 @@ function MenubarFile( editor ) {
|
|
var option = new UIRow();
|
|
var option = new UIRow();
|
|
option.setClass( 'option' );
|
|
option.setClass( 'option' );
|
|
option.setTextContent( strings.getKey( 'menubar/file/export/gltf' ) );
|
|
option.setTextContent( strings.getKey( 'menubar/file/export/gltf' ) );
|
|
- option.onClick( function () {
|
|
|
|
|
|
+ option.onClick( async function () {
|
|
|
|
|
|
var scene = editor.scene;
|
|
var scene = editor.scene;
|
|
var animations = getAnimations( scene );
|
|
var animations = getAnimations( scene );
|
|
|
|
|
|
|
|
+ var { GLTFExporter } = await import( '../../examples/jsm/exporters/GLTFExporter.js' );
|
|
|
|
+
|
|
var exporter = new GLTFExporter();
|
|
var exporter = new GLTFExporter();
|
|
|
|
|
|
exporter.parse( scene, function ( result ) {
|
|
exporter.parse( scene, function ( result ) {
|
|
@@ -286,7 +287,7 @@ function MenubarFile( editor ) {
|
|
var option = new UIRow();
|
|
var option = new UIRow();
|
|
option.setClass( 'option' );
|
|
option.setClass( 'option' );
|
|
option.setTextContent( strings.getKey( 'menubar/file/export/obj' ) );
|
|
option.setTextContent( strings.getKey( 'menubar/file/export/obj' ) );
|
|
- option.onClick( function () {
|
|
|
|
|
|
+ option.onClick( async function () {
|
|
|
|
|
|
var object = editor.selected;
|
|
var object = editor.selected;
|
|
|
|
|
|
@@ -297,6 +298,8 @@ function MenubarFile( editor ) {
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ var { OBJExporter } = await import( '../../examples/jsm/exporters/OBJExporter.js' );
|
|
|
|
+
|
|
var exporter = new OBJExporter();
|
|
var exporter = new OBJExporter();
|
|
|
|
|
|
saveString( exporter.parse( object ), 'model.obj' );
|
|
saveString( exporter.parse( object ), 'model.obj' );
|
|
@@ -309,7 +312,9 @@ function MenubarFile( editor ) {
|
|
var option = new UIRow();
|
|
var option = new UIRow();
|
|
option.setClass( 'option' );
|
|
option.setClass( 'option' );
|
|
option.setTextContent( strings.getKey( 'menubar/file/export/ply' ) );
|
|
option.setTextContent( strings.getKey( 'menubar/file/export/ply' ) );
|
|
- option.onClick( function () {
|
|
|
|
|
|
+ option.onClick( async function () {
|
|
|
|
+
|
|
|
|
+ var { PLYExporter } = await import( '../../examples/jsm/exporters/PLYExporter.js' );
|
|
|
|
|
|
var exporter = new PLYExporter();
|
|
var exporter = new PLYExporter();
|
|
|
|
|
|
@@ -327,7 +332,9 @@ function MenubarFile( editor ) {
|
|
var option = new UIRow();
|
|
var option = new UIRow();
|
|
option.setClass( 'option' );
|
|
option.setClass( 'option' );
|
|
option.setTextContent( strings.getKey( 'menubar/file/export/ply_binary' ) );
|
|
option.setTextContent( strings.getKey( 'menubar/file/export/ply_binary' ) );
|
|
- option.onClick( function () {
|
|
|
|
|
|
+ option.onClick( async function () {
|
|
|
|
+
|
|
|
|
+ var { PLYExporter } = await import( '../../examples/jsm/exporters/PLYExporter.js' );
|
|
|
|
|
|
var exporter = new PLYExporter();
|
|
var exporter = new PLYExporter();
|
|
|
|
|
|
@@ -345,7 +352,9 @@ function MenubarFile( editor ) {
|
|
var option = new UIRow();
|
|
var option = new UIRow();
|
|
option.setClass( 'option' );
|
|
option.setClass( 'option' );
|
|
option.setTextContent( strings.getKey( 'menubar/file/export/stl' ) );
|
|
option.setTextContent( strings.getKey( 'menubar/file/export/stl' ) );
|
|
- option.onClick( function () {
|
|
|
|
|
|
+ option.onClick( async function () {
|
|
|
|
+
|
|
|
|
+ var { STLExporter } = await import( '../../examples/jsm/exporters/STLExporter.js' );
|
|
|
|
|
|
var exporter = new STLExporter();
|
|
var exporter = new STLExporter();
|
|
|
|
|
|
@@ -359,7 +368,9 @@ function MenubarFile( editor ) {
|
|
var option = new UIRow();
|
|
var option = new UIRow();
|
|
option.setClass( 'option' );
|
|
option.setClass( 'option' );
|
|
option.setTextContent( strings.getKey( 'menubar/file/export/stl_binary' ) );
|
|
option.setTextContent( strings.getKey( 'menubar/file/export/stl_binary' ) );
|
|
- option.onClick( function () {
|
|
|
|
|
|
+ option.onClick( async function () {
|
|
|
|
+
|
|
|
|
+ var { STLExporter } = await import( '../../examples/jsm/exporters/STLExporter.js' );
|
|
|
|
|
|
var exporter = new STLExporter();
|
|
var exporter = new STLExporter();
|
|
|
|
|