|
@@ -74,12 +74,12 @@ MaterialLoader.prototype = Object.assign( Object.create( Loader.prototype ), {
|
|
|
|
|
|
if ( json.uuid !== undefined ) material.uuid = json.uuid;
|
|
|
if ( json.name !== undefined ) material.name = json.name;
|
|
|
- if ( json.color !== undefined ) material.color.setHex( json.color );
|
|
|
+ if ( json.color !== undefined && material.color !== undefined ) material.color.setHex( json.color );
|
|
|
if ( json.roughness !== undefined ) material.roughness = json.roughness;
|
|
|
if ( json.metalness !== undefined ) material.metalness = json.metalness;
|
|
|
if ( json.sheen !== undefined ) material.sheen = new Color().setHex( json.sheen );
|
|
|
- if ( json.emissive !== undefined ) material.emissive.setHex( json.emissive );
|
|
|
- if ( json.specular !== undefined ) material.specular.setHex( json.specular );
|
|
|
+ if ( json.emissive !== undefined && material.emissive !== undefined ) material.emissive.setHex( json.emissive );
|
|
|
+ if ( json.specular !== undefined && material.specular !== undefined ) material.specular.setHex( json.specular );
|
|
|
if ( json.shininess !== undefined ) material.shininess = json.shininess;
|
|
|
if ( json.clearcoat !== undefined ) material.clearcoat = json.clearcoat;
|
|
|
if ( json.clearcoatRoughness !== undefined ) material.clearcoatRoughness = json.clearcoatRoughness;
|