|
@@ -419,17 +419,22 @@ THREE.JSONLoader.prototype.parse = function ( json, texturePath ) {
|
|
|
|
|
|
};
|
|
|
|
|
|
- var materials = this.initMaterials( json.materials, texturePath );
|
|
|
+ if ( json.materials === undefined ) {
|
|
|
|
|
|
- if ( this.needsTangents( materials ) ) {
|
|
|
+ return { geometry: geometry };
|
|
|
|
|
|
- geometry.computeTangents();
|
|
|
+ } else {
|
|
|
|
|
|
- }
|
|
|
+ var materials = this.initMaterials( json.materials, texturePath );
|
|
|
|
|
|
- return {
|
|
|
- geometry: geometry,
|
|
|
- materials: materials
|
|
|
- };
|
|
|
+ if ( this.needsTangents( materials ) ) {
|
|
|
+
|
|
|
+ geometry.computeTangents();
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ return { geometry: geometry, materials: materials };
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
};
|