BABYLON.SceneLoader.Load("/assets/3d/", "pathing_test.obj", engine, function (scene) {
// do something with the scene
});
My Obj file looks like:
# Blender v2.91.2 OBJ File: 'ship.blend'
# www.blender.org
o path_test_1_NurbsCurve
v -1.821069 0.000000 10.709910
v -2.349467 0.000000 10.435993
v -2.812101 0.000000 10.134640
v -3.210908 0.000000 9.809603
...
v -0.333340 0.000000 -1.249982
l 1 2
l 2 3
l 3 4
My console errors are:
Babylon.js v4.2.0 - WebGL2
babylonjs.loaders.min.js?b234:16 Unhandled expression at line : l 1 2
babylonjs.loaders.min.js?b234:16 Unhandled expression at line : l 2 3
babylonjs.loaders.min.js?b234:16 Unhandled expression at line : l 3 4
babylonjs.loaders.min.js?b234:16 Unhandled expression at line : l 4 5
So it seems to be having issues with the lines not the vertex now. Thanks in advance if you can help.
the l entry in the .obj is for describing lines. Lines that are not supported in .obj loader.
Can you export without lines ?
If you need lines, I think .gltf format supports it.
Ah, the glb format did’nt work as it optimised the path out of existence. As a raw curve, and when converted to a mesh. It just ends up as a single empty transform node.
So I tried obj, I will look at the export settings.
FYI for anyone else trying to move just a curve over. The STL format seems to kill curves as well just like the GLB. Even when converted to mesh. If I export and import back into blender it’s just an empty object.
To obj seems the way to go if Babylon3D can import it.