I am loading obj file contents from a GitHub repository so I can swap out links and load new content into my online shop, my problem is some of the obj files completely fail to load without any errors in console, they just don’t show up and the loading screen doesn’t go away until I .dispose() of them. Here is my code, any help would be appreciated!
function importMesh(modelURL,albedoURL,rougnessURL){
var betterurl = loadPage(modelURL);
betterurl = betterurl.substring(betterurl.indexOf("\n") + 1);
betterurl = betterurl.substring(betterurl.indexOf("\n") + 1);
//betterurl = betterurl.substring(betterurl.indexOf("\n") + 1);
var myreturn;
BABYLON.SceneLoader.Append("", 'data:' + betterurl , scene, function (scenereturn) {
let scale = 0.18;
var hatmeshmaterial = new BABYLON.StandardMaterial("", scene);
hatmeshmaterial.diffuseTexture = new BABYLON.Texture(albedoURL, scene);
hatmeshmaterial.specularTexture = new BABYLON.Texture(rougnessURL, scene);
scenereturn.meshes[scenereturn.meshes.length -1].scaling.x = scale;
scenereturn.meshes[scenereturn.meshes.length -1].scaling.y = scale;
scenereturn.meshes[scenereturn.meshes.length -1].scaling.z = scale;
scenereturn.meshes[scenereturn.meshes.length -1].position.y = -1;
scenereturn.meshes[scenereturn.meshes.length -1].material = hatmeshmaterial;
previewhats.push(scenereturn.meshes[scenereturn.meshes.length -1]);
},this.onProgress,
this.onError,
'.obj');
}
importMesh(https://raw.githubusercontent.com/justthatrio/TimberMillContent/main/3dshades,albedo,rougness);