|
@@ -172,49 +172,52 @@ Menubar.File = function ( editor ) {
|
|
|
} );
|
|
|
options.add( option );
|
|
|
|
|
|
- // Export OBJ
|
|
|
+ //
|
|
|
+
|
|
|
+ options.add( new UI.HorizontalRule() );
|
|
|
+
|
|
|
+ // Export GLTF
|
|
|
|
|
|
var option = new UI.Row();
|
|
|
option.setClass( 'option' );
|
|
|
- option.setTextContent( 'Export OBJ' );
|
|
|
+ option.setTextContent( 'Export GLTF' );
|
|
|
option.onClick( function () {
|
|
|
|
|
|
- var object = editor.selected;
|
|
|
+ var exporter = new THREE.GLTFExporter();
|
|
|
|
|
|
- if ( object === null ) {
|
|
|
+ exporter.parse( editor.scene, function ( result ) {
|
|
|
|
|
|
- alert( 'No object selected.' );
|
|
|
- return;
|
|
|
+ saveString( JSON.stringify( result, null, 2 ), 'scene.gltf' );
|
|
|
|
|
|
- }
|
|
|
+ } );
|
|
|
|
|
|
- var exporter = new THREE.OBJExporter();
|
|
|
-
|
|
|
- saveString( exporter.parse( object ), 'model.obj' );
|
|
|
|
|
|
} );
|
|
|
options.add( option );
|
|
|
|
|
|
- // Export GLTF
|
|
|
+ // Export OBJ
|
|
|
|
|
|
var option = new UI.Row();
|
|
|
option.setClass( 'option' );
|
|
|
- option.setTextContent( 'Export GLTF2' );
|
|
|
+ option.setTextContent( 'Export OBJ' );
|
|
|
option.onClick( function () {
|
|
|
|
|
|
- var exporter = new THREE.GLTFExporter();
|
|
|
+ var object = editor.selected;
|
|
|
|
|
|
- exporter.parse( editor.scene, function ( result ) {
|
|
|
+ if ( object === null ) {
|
|
|
|
|
|
- saveString( JSON.stringify( result, null, 2 ), 'scene.gltf' );
|
|
|
+ alert( 'No object selected.' );
|
|
|
+ return;
|
|
|
|
|
|
- } );
|
|
|
+ }
|
|
|
|
|
|
+ var exporter = new THREE.OBJExporter();
|
|
|
+
|
|
|
+ saveString( exporter.parse( object ), 'model.obj' );
|
|
|
|
|
|
} );
|
|
|
options.add( option );
|
|
|
|
|
|
-
|
|
|
// Export STL
|
|
|
|
|
|
var option = new UI.Row();
|