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

Editor: Wired up selected to Config.

上级 45a5cda9
......@@ -291,25 +291,40 @@ Editor.prototype = {
select: function ( object ) {
this.selected = object;
this.config.setKey( 'selected', object.uuid );
this.signals.objectSelected.dispatch( object );
},
selectById: function ( id ) {
var object = null;
var scope = this;
this.scene.traverse( function ( child ) {
if ( child.id === id ) {
object = child;
scope.select( child );
}
} );
this.select( object );
},
selectByUuid: function ( uuid ) {
var scope = this;
this.scene.traverse( function ( child ) {
if ( child.uuid === uuid ) {
scope.select( child );
}
} );
},
......
......@@ -16,6 +16,14 @@ var Loader = function ( editor ) {
}
var selected = editor.config.getKey( 'selected' );
if ( selected !== undefined ) {
editor.selectByUuid( selected );
}
};
var exporter = new THREE.ObjectExporter();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册