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

Editor: Yet more optimisations and clean up.

上级 27754463
...@@ -45,6 +45,8 @@ var Editor = function () { ...@@ -45,6 +45,8 @@ var Editor = function () {
this.loader = new Loader( this ); this.loader = new Loader( this );
this.scene = new THREE.Scene(); this.scene = new THREE.Scene();
this.scene.name = 'Scene';
this.sceneHelpers = new THREE.Scene(); this.sceneHelpers = new THREE.Scene();
this.object = {}; this.object = {};
......
...@@ -434,24 +434,13 @@ Sidebar.Object3D = function ( editor ) { ...@@ -434,24 +434,13 @@ Sidebar.Object3D = function ( editor ) {
signals.sceneGraphChanged.add( function () { signals.sceneGraphChanged.add( function () {
var scene = editor.scene; var scene = editor.scene;
var options = {}; var options = {};
options[ scene.id ] = 'Scene'; scene.traverse( function ( object ) {
( function addObjects( objects ) {
for ( var i = 0, l = objects.length; i < l; i ++ ) {
var object = objects[ i ];
options[ object.id ] = object.name; options[ object.id ] = object.name;
addObjects( object.children );
}
} )( scene.children ); } );
objectParent.setOptions( options ); objectParent.setOptions( options );
......
...@@ -591,8 +591,6 @@ var Viewport = function ( editor ) { ...@@ -591,8 +591,6 @@ var Viewport = function ( editor ) {
function render() { function render() {
console.trace();
sceneHelpers.updateMatrixWorld(); sceneHelpers.updateMatrixWorld();
scene.updateMatrixWorld(); scene.updateMatrixWorld();
......
...@@ -480,7 +480,13 @@ UI.Select.prototype.getValue = function () { ...@@ -480,7 +480,13 @@ UI.Select.prototype.getValue = function () {
UI.Select.prototype.setValue = function ( value ) { UI.Select.prototype.setValue = function ( value ) {
this.dom.value = value; value = String( value );
if ( this.dom.value !== value ) {
this.dom.value = value;
}
return this; return this;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册