Browse Source

Object3D: Simplify layers serialization

Mugen87 7 years ago
parent
commit
1be56d6c36
1 changed files with 1 additions and 7 deletions
  1. 1 7
      src/core/Object3D.js

+ 1 - 7
src/core/Object3D.js

@@ -659,17 +659,11 @@ Object3D.prototype = Object.assign( Object.create( EventDispatcher.prototype ),
 		if ( this.renderOrder !== 0 ) object.renderOrder = this.renderOrder;
 		if ( this.renderOrder !== 0 ) object.renderOrder = this.renderOrder;
 		if ( JSON.stringify( this.userData ) !== '{}' ) object.userData = this.userData;
 		if ( JSON.stringify( this.userData ) !== '{}' ) object.userData = this.userData;
 
 
+		object.layers = { mask: this.layers.mask };
 		object.matrix = this.matrix.toArray();
 		object.matrix = this.matrix.toArray();
 
 
 		if ( this.matrixAutoUpdate === false ) object.matrixAutoUpdate = false;
 		if ( this.matrixAutoUpdate === false ) object.matrixAutoUpdate = false;
 
 
-		if ( this.layers.mask !== 1 ) {
-
-			object.layers = {};
-			object.layers.mask = this.layers.mask;
-
-		}
-
 		//
 		//
 
 
 		function serialize( library, element ) {
 		function serialize( library, element ) {