|
@@ -155,6 +155,30 @@ Editor.prototype = {
|
|
|
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
+ moveObject: function ( object, parent, before ) {
|
|
|
|
+
|
|
|
|
+ if ( parent === undefined ) {
|
|
|
|
+
|
|
|
|
+ parent = this.scene;
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ parent.add( object );
|
|
|
|
+
|
|
|
|
+ // sort children array
|
|
|
|
+
|
|
|
|
+ if ( before !== undefined ) {
|
|
|
|
+
|
|
|
|
+ var index = parent.children.indexOf( before );
|
|
|
|
+ parent.children.splice( index, 0, object );
|
|
|
|
+ parent.children.pop();
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ this.signals.sceneGraphChanged.dispatch();
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+
|
|
nameObject: function ( object, name ) {
|
|
nameObject: function ( object, name ) {
|
|
|
|
|
|
object.name = name;
|
|
object.name = name;
|
|
@@ -319,32 +343,6 @@ Editor.prototype = {
|
|
|
|
|
|
//
|
|
//
|
|
|
|
|
|
- parent: function ( object, parent, before ) {
|
|
|
|
-
|
|
|
|
- if ( parent === undefined ) {
|
|
|
|
-
|
|
|
|
- parent = this.scene;
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- parent.add( object );
|
|
|
|
-
|
|
|
|
- // sort children array
|
|
|
|
-
|
|
|
|
- if ( before !== undefined ) {
|
|
|
|
-
|
|
|
|
- var index = parent.children.indexOf( before );
|
|
|
|
- parent.children.splice( index, 0, object );
|
|
|
|
- parent.children.pop();
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- this.signals.sceneGraphChanged.dispatch();
|
|
|
|
-
|
|
|
|
- },
|
|
|
|
-
|
|
|
|
- //
|
|
|
|
-
|
|
|
|
select: function ( object ) {
|
|
select: function ( object ) {
|
|
|
|
|
|
if ( this.selected === object ) return;
|
|
if ( this.selected === object ) return;
|