|
@@ -38,6 +38,47 @@ Menubar.Edit = function ( editor ) {
|
|
|
} );
|
|
|
options.add( option );
|
|
|
|
|
|
+ // delete
|
|
|
+
|
|
|
+ var option = new UI.Panel();
|
|
|
+ option.setClass( 'option' );
|
|
|
+ option.setTextContent( 'Delete' );
|
|
|
+ option.onClick( function () {
|
|
|
+
|
|
|
+ editor.removeObject( editor.selected );
|
|
|
+ editor.deselect();
|
|
|
+
|
|
|
+ } );
|
|
|
+ options.add( option );
|
|
|
+
|
|
|
+ options.add( new UI.HorizontalRule() );
|
|
|
+
|
|
|
+ // convert to BufferGeometry
|
|
|
+
|
|
|
+ var option = new UI.Panel();
|
|
|
+ option.setClass( 'option' );
|
|
|
+ option.setTextContent( 'Convert' );
|
|
|
+ option.onClick( function () {
|
|
|
+
|
|
|
+ var object = editor.selected;
|
|
|
+
|
|
|
+ if ( object.geometry instanceof THREE.Geometry ) {
|
|
|
+
|
|
|
+ if ( object.parent === undefined ) return; // avoid flattening the camera or scene
|
|
|
+
|
|
|
+ if ( confirm( 'Convert ' + object.name + ' to BufferGeometry?' ) === false ) return;
|
|
|
+
|
|
|
+ delete object.__webglInit; // TODO: Remove hack (WebGLRenderer refactoring)
|
|
|
+
|
|
|
+ object.geometry = THREE.BufferGeometryUtils.fromGeometry( object.geometry );
|
|
|
+
|
|
|
+ editor.signals.objectChanged.dispatch( object );
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ } );
|
|
|
+ options.add( option );
|
|
|
+
|
|
|
// flatten
|
|
|
|
|
|
var option = new UI.Panel();
|
|
@@ -67,18 +108,6 @@ Menubar.Edit = function ( editor ) {
|
|
|
} );
|
|
|
options.add( option );
|
|
|
|
|
|
- // delete
|
|
|
-
|
|
|
- var option = new UI.Panel();
|
|
|
- option.setClass( 'option' );
|
|
|
- option.setTextContent( 'Delete' );
|
|
|
- option.onClick( function () {
|
|
|
-
|
|
|
- editor.removeObject( editor.selected );
|
|
|
- editor.deselect();
|
|
|
-
|
|
|
- } );
|
|
|
- options.add( option );
|
|
|
|
|
|
//
|
|
|
|