From 2e4462737b56c0531d1d96b2da57b1d5cafa4f9c Mon Sep 17 00:00:00 2001 From: "Mr.doob" Date: Tue, 23 Jul 2013 00:34:02 +0200 Subject: [PATCH] Editor: Merged geometry exporter options. --- editor/index.html | 2 +- editor/js/Menubar.File.js | 19 ++++++++----------- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/editor/index.html b/editor/index.html index 689cece86f..840de1071e 100644 --- a/editor/index.html +++ b/editor/index.html @@ -39,7 +39,7 @@ .menubar .menu .options { padding: 5px 0px; background-color: #fff; - width: 170px; + width: 140px; } .menubar .menu .options hr { diff --git a/editor/js/Menubar.File.js b/editor/js/Menubar.File.js index 7c03c4180a..ad908d1bf3 100644 --- a/editor/js/Menubar.File.js +++ b/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 ); -- GitLab