提交 7dd2849c 编写于 作者: D Daniel

Removed duplicate editor.select()-calls

CmdAddObject and CmdRemoveObject now handle the selection
上级 b3924894
......@@ -295,7 +295,6 @@
var parent = object.parent;
if ( parent !== null ) editor.execute( new CmdRemoveObject( object ) );
editor.select( parent );
break;
......
......@@ -37,6 +37,7 @@ CmdRemoveObject.prototype = {
} );
this.parent.remove( this.object );
this.editor.select( this.parent );
this.editor.signals.objectRemoved.dispatch( this.object );
this.editor.signals.sceneGraphChanged.dispatch();
......
......@@ -25,7 +25,6 @@ var Loader = function ( editor ) {
var amfobject = loader.parse( event.target.result );
editor.execute( new CmdAddObject( amfobject ) );
editor.select( amfobject );
}, false );
reader.readAsArrayBuffer( file );
......@@ -82,7 +81,6 @@ var Loader = function ( editor ) {
mesh.name = filename;
editor.execute( new CmdAddObject( mesh ) );
editor.select( mesh );
}, false );
reader.readAsText( file );
......@@ -111,7 +109,6 @@ var Loader = function ( editor ) {
mesh.name = filename;
editor.execute( new CmdAddObject( mesh ) );
editor.select( mesh );
} );
......@@ -133,7 +130,6 @@ var Loader = function ( editor ) {
collada.scene.name = filename;
editor.execute( new CmdAddObject( collada.scene ) );
editor.select( collada.scene );
}, false );
reader.readAsText( file );
......@@ -209,7 +205,6 @@ var Loader = function ( editor ) {
collada.scene.name = filename;
editor.execute( new CmdAddObject( collada.scene ) );
editor.select( collada.scene );
}, false );
reader.readAsArrayBuffer( file );
......@@ -234,7 +229,6 @@ var Loader = function ( editor ) {
mesh.name = filename;
editor.execute( new CmdAddObject( mesh ) );
editor.select( mesh );
}, false );
reader.readAsArrayBuffer( file );
......@@ -252,7 +246,6 @@ var Loader = function ( editor ) {
object.name = filename;
editor.execute( new CmdAddObject( object ) );
editor.select( object );
}, false );
reader.readAsText( file );
......@@ -276,7 +269,6 @@ var Loader = function ( editor ) {
mesh.name = filename;
editor.execute( new CmdAddObject( mesh ) );
editor.select( mesh );
}, false );
reader.readAsText( file );
......@@ -300,7 +292,6 @@ var Loader = function ( editor ) {
mesh.name = filename;
editor.execute( new CmdAddObject( mesh ) );
editor.select( mesh );
}, false );
......@@ -330,7 +321,6 @@ var Loader = function ( editor ) {
var mesh = new THREE.Mesh( geometry, material );
editor.execute( new CmdAddObject( mesh ) );
editor.select( mesh );
}, false );
reader.readAsBinaryString( file );
......@@ -355,7 +345,6 @@ var Loader = function ( editor ) {
mesh.name = filename;
editor.execute( new CmdAddObject( mesh ) );
editor.select( mesh );
}, false );
reader.readAsText( file );
......@@ -416,7 +405,6 @@ var Loader = function ( editor ) {
var mesh = new THREE.Mesh( result );
editor.execute( new CmdAddObject( mesh ) );
editor.select( mesh );
} else if ( data.metadata.type.toLowerCase() === 'geometry' ) {
......@@ -464,7 +452,6 @@ var Loader = function ( editor ) {
mesh.name = filename;
editor.execute( new CmdAddObject( mesh ) );
editor.select( mesh );
} else if ( data.metadata.type.toLowerCase() === 'object' ) {
......@@ -480,7 +467,6 @@ var Loader = function ( editor ) {
} else {
editor.execute( new CmdAddObject( result ) );
editor.select( result );
}
......
......@@ -41,7 +41,6 @@ Menubar.Add = function ( editor ) {
mesh.name = 'Group ' + ( ++ meshCount );
editor.execute( new CmdAddObject( mesh ) );
editor.select( mesh );
} );
options.add( option );
......@@ -69,7 +68,6 @@ Menubar.Add = function ( editor ) {
mesh.name = 'Plane ' + ( ++ meshCount );
editor.execute( new CmdAddObject( mesh ) );
editor.select( mesh );
} );
options.add( option );
......@@ -94,7 +92,6 @@ Menubar.Add = function ( editor ) {
mesh.name = 'Box ' + ( ++ meshCount );
editor.execute( new CmdAddObject( mesh ) );
editor.select( mesh );
} );
options.add( option );
......@@ -114,7 +111,6 @@ Menubar.Add = function ( editor ) {
mesh.name = 'Circle ' + ( ++ meshCount );
editor.execute( new CmdAddObject( mesh ) );
editor.select( mesh );
} );
options.add( option );
......@@ -138,7 +134,6 @@ Menubar.Add = function ( editor ) {
mesh.name = 'Cylinder ' + ( ++ meshCount );
editor.execute( new CmdAddObject( mesh ) );
editor.select( mesh );
} );
options.add( option );
......@@ -163,7 +158,6 @@ Menubar.Add = function ( editor ) {
mesh.name = 'Sphere ' + ( ++ meshCount );
editor.execute( new CmdAddObject( mesh ) );
editor.select( mesh );
} );
options.add( option );
......@@ -183,7 +177,6 @@ Menubar.Add = function ( editor ) {
mesh.name = 'Icosahedron ' + ( ++ meshCount );
editor.execute( new CmdAddObject( mesh ) );
editor.select( mesh );
} );
options.add( option );
......@@ -206,7 +199,6 @@ Menubar.Add = function ( editor ) {
mesh.name = 'Torus ' + ( ++ meshCount );
editor.execute( new CmdAddObject( mesh ) );
editor.select( mesh );
} );
options.add( option );
......@@ -231,7 +223,6 @@ Menubar.Add = function ( editor ) {
mesh.name = 'TorusKnot ' + ( ++ meshCount );
editor.execute( new CmdAddObject( mesh ) );
editor.select( mesh );
} );
options.add( option );
......@@ -277,7 +268,6 @@ Menubar.Add = function ( editor ) {
sprite.name = 'Sprite ' + ( ++ meshCount );
editor.execute( new CmdAddObject( sprite ) );
editor.select( sprite );
} );
options.add( option );
......@@ -301,7 +291,6 @@ Menubar.Add = function ( editor ) {
light.name = 'PointLight ' + ( ++ lightCount );
editor.execute( new CmdAddObject( light ) );
editor.select( light );
} );
options.add( option );
......@@ -326,7 +315,6 @@ Menubar.Add = function ( editor ) {
light.position.set( 0.5, 1, 0.75 ).multiplyScalar( 200 );
editor.execute( new CmdAddObject( light ) );
editor.select( light );
} );
options.add( option );
......@@ -348,7 +336,6 @@ Menubar.Add = function ( editor ) {
light.position.set( 0.5, 1, 0.75 ).multiplyScalar( 200 );
editor.execute( new CmdAddObject( light ) );
editor.select( light );
} );
options.add( option );
......@@ -370,7 +357,6 @@ Menubar.Add = function ( editor ) {
light.position.set( 0.5, 1, 0.75 ).multiplyScalar( 200 );
editor.execute( new CmdAddObject( light ) );
editor.select( light );
} );
options.add( option );
......@@ -388,7 +374,6 @@ Menubar.Add = function ( editor ) {
light.name = 'AmbientLight ' + ( ++ lightCount );
editor.execute( new CmdAddObject( light ) );
editor.select( light );
} );
options.add( option );
......@@ -408,7 +393,6 @@ Menubar.Add = function ( editor ) {
camera.name = 'PerspectiveCamera ' + ( ++ cameraCount );
editor.execute( new CmdAddObject( camera ) );
editor.select( camera );
} );
options.add( option );
......
......@@ -96,7 +96,6 @@ Menubar.Edit = function ( editor ) {
object = object.clone();
editor.execute( new CmdAddObject( object ) );
editor.select( object );
} );
options.add( option );
......@@ -116,7 +115,6 @@ Menubar.Edit = function ( editor ) {
if ( parent === undefined ) return; // avoid deleting the camera or scene
editor.execute( new CmdRemoveObject( object ) );
editor.select( parent );
} );
options.add( option );
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册