|
@@ -81,28 +81,31 @@ THREE.Material.prototype = {
|
|
|
|
|
|
}
|
|
|
|
|
|
- if ( key in this ) {
|
|
|
+ var currentValue = this[ key ];
|
|
|
|
|
|
- var currentValue = this[ key ];
|
|
|
+ if ( currentValue === undefined ) {
|
|
|
|
|
|
- if ( currentValue instanceof THREE.Color ) {
|
|
|
+ console.warn( "THREE." + this.type + ": '" + key + "' is not a property of this material." );
|
|
|
+ continue;
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
- currentValue.set( newValue );
|
|
|
+ if ( currentValue instanceof THREE.Color ) {
|
|
|
|
|
|
- } else if ( currentValue instanceof THREE.Vector3 && newValue instanceof THREE.Vector3 ) {
|
|
|
+ currentValue.set( newValue );
|
|
|
|
|
|
- currentValue.copy( newValue );
|
|
|
+ } else if ( currentValue instanceof THREE.Vector3 && newValue instanceof THREE.Vector3 ) {
|
|
|
|
|
|
- } else if ( key === 'overdraw' ) {
|
|
|
+ currentValue.copy( newValue );
|
|
|
|
|
|
- // ensure overdraw is backwards-compatible with legacy boolean type
|
|
|
- this[ key ] = Number( newValue );
|
|
|
+ } else if ( key === 'overdraw' ) {
|
|
|
|
|
|
- } else {
|
|
|
+ // ensure overdraw is backwards-compatible with legacy boolean type
|
|
|
+ this[ key ] = Number( newValue );
|
|
|
|
|
|
- this[ key ] = newValue;
|
|
|
+ } else {
|
|
|
|
|
|
- }
|
|
|
+ this[ key ] = newValue;
|
|
|
|
|
|
}
|
|
|
|