Let’s say I have .obj and .mtl files uploaded on Google Storage in the same bucket/folder
I can directly fetch .obj and it loads, but the .mtl doesn’t load. How do I solve this. Do I need to fetch .mtl separately and somehow connect it with the scene?
You can see in the image where it looks for the .mtl, but that path is actually not right, so it makes sense that it gives me 404 because .mtl doesn’t exist there. It is in the storage and have it’s own downloadURL. But I don’t know what to get it properly.
If I copy this exact piece of code into my project, I get error shown above. So I am not really sure what is going on. Maybe I am missing some dependencies (i tried adding import babylon-materials, nothing happened).
I am using 4.1 version
I will try to investigate further, don’t have time today for that.
I’m not exactly sure how Google Storage works, but the obj you are trying to load will automatically try to the load the mtl but without the extra parameters. I’m not sure if there is a way to figure that out without hard coding. One way to do this is to use the preprocessUrl function. Like this:
Wow man. You have no idea how much you helped me with this.I didn’t have time to test it out earlier, but I’ve implemented it now, and managed to preprocess the urls properly. Thank you so much, I really appreciate it.