Hello everyone, I’m trying to import a model from blender3D in babylon format, that is, the official export of the engine, but it tells me
Error while trying to load image:
Anybody knows what could be the problem.
Code and models
flappy bird babylon.zip (14.7 KB)
BABYLON.SceneLoader.ImportMesh("","/./","babylonExportBlender/Escenario.babylon",scene,
//BABYLON.SceneLoader.ImportMesh("","/./","Gltf/Escenario.glb",scene,
function (newMeshes)
{
scene.createDefaultEnvironment();
});
I am pretty sure the “/./” is not a legal path. That is saying from the root directory, use the current directory. Try “./”
The path is relative to the html file. You are using the subdirectory of “babylonExportBlender/” for the .babylon file. You should use the same for your textures.
1 Like
They are in the same directory, but it doesn’t work
The strange thing is that with glTF2 if it works
TEXTURES HAVE TO GO IN THE SAME PLACE AS .HTML AS A SIMPLE SOLUTION TO THIS PROBLEM
I do not understand the problem well because it would have to work if it is in the same folder, there is something that does not close me, but check that if the textures are in the same place as the HTML file they are loaded correctly
In this video the correct operation is seen.
The problem was that path was in the root and not in the folder where the files are … To solve it in the second parameter of “BABYLON.SceneLoader.ImportMesh” you have to put the location of the folder and in the third the name of the scene as seen in the following image
This way it is possible to import complete Blender3D scenarios into babylon with textures and everything.
1 Like