Browse Source

Editor: Merged geometry exporter options.

Mr.doob 12 years ago
parent
commit
2e4462737b
2 changed files with 9 additions and 12 deletions
  1. 1 1
      editor/index.html
  2. 8 11
      editor/js/Menubar.File.js

+ 1 - 1
editor/index.html

@@ -39,7 +39,7 @@
 					.menubar .menu .options {
 						padding: 5px 0px;
 						background-color: #fff;
-						width: 170px;
+						width: 140px;
 					}
 
 						.menubar .menu .options hr {

+ 8 - 11
editor/js/Menubar.File.js

@@ -67,27 +67,24 @@ Menubar.File = function ( editor ) {
 	options.add( new UI.HorizontalRule() );
 
 
-	// export buffergeometry
+	// export geometry
 
 	var option = new UI.Panel();
 	option.setClass( 'option' );
-	option.setTextContent( 'Export BufferGeometry' );
+	option.setTextContent( 'Export Geometry' );
 	option.onClick( function () {
 
-		exportGeometry( THREE.BufferGeometryExporter );
+		var geometry = editor.selected.geometry;
 
-	} );
-	options.add( option );
+		if ( geometry instanceof THREE.BufferGeometry ) {
 
+			exportGeometry( THREE.BufferGeometryExporter );
 
-	// export geometry
+		} else if ( geometry instanceof THREE.Geometry ) {
 
-	var option = new UI.Panel();
-	option.setClass( 'option' );
-	option.setTextContent( 'Export Geometry' );
-	option.onClick( function () {
+			exportGeometry( THREE.GeometryExporter );
 
-		exportGeometry( THREE.GeometryExporter );
+		}
 
 	} );
 	options.add( option );