From 7418cb266e15293c3130dab1e9b055e051d4e312 Mon Sep 17 00:00:00 2001 From: Anas Alhamdan Date: Thu, 12 Jun 2014 16:19:16 +0300 Subject: [PATCH] Update AssimpJSONLoader.js sometimes assimp2json does not add texturecoords --- examples/js/loaders/AssimpJSONLoader.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/examples/js/loaders/AssimpJSONLoader.js b/examples/js/loaders/AssimpJSONLoader.js index 26c669be37..ab47ebf560 100644 --- a/examples/js/loaders/AssimpJSONLoader.js +++ b/examples/js/loaders/AssimpJSONLoader.js @@ -85,6 +85,7 @@ THREE.AssimpJSONLoader.prototype = { } // read texture coordinates - three.js attaches them to its faces + json.texturecoords = json.texturecoords || []; for(i = 0, e = json.texturecoords.length; i < e; ++i) { function convertTextureCoords(in_uv, out_faces, out_vertex_uvs) { @@ -219,7 +220,9 @@ THREE.AssimpJSONLoader.prototype = { has_textures.push(keyname); loader.setCrossOrigin(this.crossOrigin); - loader.load(scope.texturePath + '/' + prop.value, function(tex) { + var material_url = scope.texturePath + '/' + prop.value + material_url = material_url.replace(/\\/g, '/'); + loader.load(material_url, function(tex) { if(tex) { // TODO: read texture settings from assimp. // Wrapping is the default, though. -- GitLab