|
@@ -123,9 +123,39 @@ THREE.Material.prototype = {
|
|
|
data.type = this.type;
|
|
|
if ( this.name !== '' ) data.name = this.name;
|
|
|
|
|
|
+ if ( this.color instanceof THREE.Color ) data.color = this.color.getHex();
|
|
|
+ if ( this.emissive instanceof THREE.Color ) data.emissive = this.emissive.getHex();
|
|
|
+ if ( this.specular instanceof THREE.Color ) data.specular = this.specular.getHex();
|
|
|
+ if ( this.shininess !== undefined ) data.shininess = this.shininess;
|
|
|
+
|
|
|
+ if ( this.map instanceof THREE.Texture ) data.map = this.map.toJSON( meta ).uuid;
|
|
|
+ if ( this.alphaMap instanceof THREE.Texture ) data.alphaMap = this.alphaMap.toJSON( meta ).uuid;
|
|
|
+ if ( this.lightMap instanceof THREE.Texture ) data.lightMap = this.lightMap.toJSON( meta ).uuid;
|
|
|
+ if ( this.bumpMap instanceof THREE.Texture ) {
|
|
|
+ data.bumpMap = this.bumpMap.toJSON( meta ).uuid;
|
|
|
+ data.bumpScale = this.bumpScale;
|
|
|
+ }
|
|
|
+ if ( this.normalMap instanceof THREE.Texture ) {
|
|
|
+ data.normalMap = this.normalMap.toJSON( meta ).uuid;
|
|
|
+ data.normalScale = this.normalScale; // Removed for now, causes issue in editor ui.js
|
|
|
+ }
|
|
|
+ if ( this.specularMap instanceof THREE.Texture ) data.specularMap = this.specularMap.toJSON( meta ).uuid;
|
|
|
+ if ( this.envMap instanceof THREE.Texture ) {
|
|
|
+ data.envMap = this.envMap.toJSON( meta ).uuid;
|
|
|
+ data.reflectivity = this.reflectivity; // Scale behind envMap
|
|
|
+ }
|
|
|
+
|
|
|
+ if ( this.size !== undefined ) data.size = this.size;
|
|
|
+ if ( this.sizeAttenuation !== undefined ) data.sizeAttenuation = this.sizeAttenuation;
|
|
|
+
|
|
|
+ if ( this.vertexColors !== undefined && this.vertexColors !== THREE.NoColors ) data.vertexColors = this.vertexColors;
|
|
|
+ if ( this.shading !== undefined && this.shading !== THREE.SmoothShading ) data.shading = this.shading;
|
|
|
+ if ( this.blending !== undefined && this.blending !== THREE.NormalBlending ) data.blending = this.blending;
|
|
|
+ if ( this.side !== undefined && this.side !== THREE.FrontSide ) data.side = this.side;
|
|
|
+
|
|
|
if ( this.opacity < 1 ) data.opacity = this.opacity;
|
|
|
- if ( this.transparent !== false ) data.transparent = this.transparent;
|
|
|
- if ( this.wireframe !== false ) data.wireframe = this.wireframe;
|
|
|
+ if ( this.transparent === true ) data.transparent = this.transparent;
|
|
|
+ if ( this.wireframe === true ) data.wireframe = this.wireframe;
|
|
|
|
|
|
return data;
|
|
|
|