Some OBJ files still give unhandled expression on load - babylonjs loaders

I seem to be experiencing an issues pretty close to this one looks like the fix should be in though, and I am still getting it.

I have a NurbsCurve created in blender, and exported as an obj.

my Babylon versions are:

    "babylonjs": "^4.2.0",
    "babylonjs-loaders": "^4.2.0",

My loading code is:

    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.

ping @Drigax

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.

I just tired the Curves as NURBS option in the blender obj exporter, but still no luck.

OBJ file:

# Blender v2.91.2 OBJ File: 'ship.blend'
# www.blender.org
v 9.123311 0.000000 8.439651
v -1.995049 0.000000 8.439651
v -1.976473 0.000000 2.331339
v 4.813529 0.000000 4.435480
v 4.813529 0.000000 1.000000
v -0.500000 0.000000 0.500000
v -0.500000 0.000000 -1.500000
v 0.500000 0.000000 -2.000000
g path_test_2
cstype bspline
deg 3
curv 0.0 1.0 -1 -2 -3 -4 -5 -6 -7 -8
parm u 0.000000 0.090909 0.181818 0.272727 0.363636 0.454545 0.545455 0.636364 0.727273 0.818182 0.909091 1.000000
end

Error:

Babylon.js v4.2.0 - WebGL2
babylonjs.loaders.min.js?b234:16 Unhandled expression at line : cstype bspline
babylonjs.loaders.min.js?b234:16 Unhandled expression at line : deg 3
babylonjs.loaders.min.js?b234:16 Unhandled expression at line : parm u 0.000000 0.090909 0.181818 0.272727 0.363636 0.454545 0.545455 0.636364 0.727273 0.818182 0.909091 1.000000
babylonjs

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.

Not the first one to hit this issue: Looks like someone opted to script it