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

Editor: Fixed errors when selecting Scene.

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