Browse Source

CmdAddObject simplified

Daniel 10 năm trước cách đây
mục cha
commit
91161bf49a
1 tập tin đã thay đổi với 2 bổ sung4 xóa
  1. 2 4
      editor/js/CmdAddObject.js

+ 2 - 4
editor/js/CmdAddObject.js

@@ -23,15 +23,13 @@ CmdAddObject = function ( object ) {
 
 
 		if ( object.geometry !== undefined ) {
 		if ( object.geometry !== undefined ) {
 
 
-			this.objectJSON.geometries = [];
-			this.objectJSON.geometries.push( object.geometry.toJSON( meta ) );
+			this.objectJSON.geometries = [ object.geometry.toJSON( meta ) ];
 
 
 		}
 		}
 
 
 		if ( object.material !== undefined ) {
 		if ( object.material !== undefined ) {
 
 
-			this.objectJSON.materials = [];
-			this.objectJSON.materials.push( object.material.toJSON( meta ) );
+			this.objectJSON.materials = [ object.material.toJSON( meta ) ];
 
 
 		}
 		}