提交 4da43c94 编写于 作者: M Mr.doob

Editor: Fixed errors when selecting Scene.

上级 9a2e179c
...@@ -259,7 +259,19 @@ Editor.prototype = { ...@@ -259,7 +259,19 @@ Editor.prototype = {
selectById: function ( id ) { selectById: function ( id ) {
this.select( this.scene.getObjectById( id, true ) ); var object = null;
this.scene.traverse( function ( child ) {
if ( child.id === id ) {
object = child;
}
} );
this.select( object );
}, },
......
...@@ -2,8 +2,6 @@ Sidebar.Scene = function ( editor ) { ...@@ -2,8 +2,6 @@ Sidebar.Scene = function ( editor ) {
var signals = editor.signals; var signals = editor.signals;
var selected = null;
var container = new UI.Panel(); var container = new UI.Panel();
container.setPadding( '10px' ); container.setPadding( '10px' );
container.setBorderTop( '1px solid #ccc' ); container.setBorderTop( '1px solid #ccc' );
...@@ -169,7 +167,12 @@ Sidebar.Scene = function ( editor ) { ...@@ -169,7 +167,12 @@ Sidebar.Scene = function ( editor ) {
} )( scene.children, '   ' ); } )( scene.children, '   ' );
outliner.setOptions( options ); outliner.setOptions( options );
outliner.setValue( selected );
if ( editor.selected !== null ) {
outliner.setValue( editor.selected.id );
}
if ( scene.fog ) { if ( scene.fog ) {
...@@ -200,9 +203,7 @@ Sidebar.Scene = function ( editor ) { ...@@ -200,9 +203,7 @@ Sidebar.Scene = function ( editor ) {
signals.objectSelected.add( function ( object ) { signals.objectSelected.add( function ( object ) {
selected = object !== null ? object.id : null; outliner.setValue( object.id );
outliner.setValue( selected );
} ); } );
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册