IllegalStateException thrown by jme on attempting to import a WaveFront.OBJ file

I’d like to get some insight into the limitations, if any, of the JME ObjLoader as it currently throws the exception seen below when trying to load a certain .OBJ file. The code used to do the loading is simply:

[java]ship = (Node)assetManager.loadModel(“Object.obj”);[/java]

During loading, I notice the following jme issued warning first. This warning is given 100+ times.

[java]WARNING: Appending single line not yet supported!
des 02, 2013 10:12:27 AM com.jme3.scene.plugins.blender.meshes.MeshBuilder appendEdge
[/java]

Next, I noticed the following two warnings:

[java]WARNING: Unknown statement in MTL! bump-front.png
des 02, 2013 10:14:35 AM com.jme3.scene.plugins.MTLLoader readLine
WARNING: Unknown statement in MTL! map_opacity
des 02, 2013 10:14:35 AM class com.jme3.app.AppTask invoke()
[/java]

Immediately following these warnings is the crash:

[java]java.lang.IllegalStateException: No loader registered for type “”
at com.jme3.asset.ImplHandler.aquireLoader(ImplHandler.java:199)
at com.jme3.asset.DesktopAssetManager.loadAsset(DesktopAssetManager.java:266)
at com.jme3.asset.DesktopAssetManager.loadTexture(DesktopAssetManager.java:341)
at com.jme3.scene.plugins.MTLLoader.loadTexture(MTLLoader.java:182)
at com.jme3.scene.plugins.MTLLoader.readLine(MTLLoader.java:250)
at com.jme3.scene.plugins.MTLLoader.load(MTLLoader.java:304)
at com.jme3.asset.DesktopAssetManager.loadAsset(DesktopAssetManager.java:283)
at com.jme3.scene.plugins.OBJLoader.loadMtlLib(OBJLoader.java:335)
at com.jme3.scene.plugins.OBJLoader.readLine(OBJLoader.java:388)
at com.jme3.scene.plugins.OBJLoader.load(OBJLoader.java:577)
at com.jme3.asset.DesktopAssetManager.loadAsset(DesktopAssetManager.java:283)
at com.jme3.asset.DesktopAssetManager.loadModel(DesktopAssetManager.java:369)
at com.jme3.asset.DesktopAssetManager.loadModel(DesktopAssetManager.java:373)
[/java]

Initially I thought it might be related to things declared in the .mtl file that is not supported by the jme obj loader, so I tried to remove the offending lines from my .mtl file. This got rid of the two “Unknown statement” warnings, but it still crashes with the trace above.

I’ll post the full .mtl file below. Can anybody tell me whether there is a problem in this file, and if so, what it is?

[java]newmtl PaintGloss
Ka 0 0 0
Kd 1 1 1
Ks 0 0.150588 0
illum 2
Ns 512
map_Kd HULL-FRONT.png
map_bump BUMP-FRONT.png
bump BUMP-FRONT.png
map_opacity
map_d
refl
map_kS
map_kA
map_Ns

newmtl PaintlSemi
Ka 0 0 0
Kd 1 1 1
Ks 0.108235 0.176471 0.101176
illum 2
Ns 128
map_Kd HULL-FRONT.png
map_bump
bump
map_opacity
map_d
refl
map_kS
map_kA
map_Ns

newmtl PaintMatte
Ka 0 0 0
Kd 1 1 1
Ks 0.105882 0.141176 0.106667
illum 2
Ns 5.65685
map_Kd HULL-FRONT.png
map_bump
bump
map_opacity
map_d
refl
map_kS
map_kA
map_Ns

newmtl Deck
Ka 0 0 0
Kd 1 1 1
Ks 0.02 0.130588 0.0858824
illum 2
Ns 128
map_Kd HULL-FRONT.png
map_bump BUMP-FRONT.png
bump BUMP-FRONT.png
map_opacity
map_d
refl
map_kS
map_kA
map_Ns

newmtl Glass
Ka 0 0 0
Kd 0.0164706 0.0164706 0.0164706
Ks 0.0109804 0.0109804 0.0109804
illum 2
Ns 2048
map_Kd
map_bump
bump
map_opacity
map_d
refl
map_kS
map_kA
map_Ns

newmtl Chrome
Ka 0 0 0
Kd 0.282706 0.282706 0.282706
Ks 0.691059 0.691059 0.691059
illum 2
Ns 2048
map_Kd
map_bump
bump
map_opacity
map_d
refl
map_kS
map_kA
map_Ns

newmtl Transparent
Ka 0 0 0
Kd 1 1 1
Ks 0.357 0.408 0.387
illum 2
Ns 2048
d 0.77
map_Kd HULL-FRONT.png
map_bump
bump
map_opacity
map_d
refl
map_kS
map_kA
map_Ns

newmtl Explorer_Default
Ka 0.117647 0.117647 0.117647
Kd 0.752941 0.752941 0.752941
Ks 0.752941 0.752941 0.752941
illum 2
Ns 8
map_Kd
map_bump
bump
map_opacity
map_d
refl
map_kS
map_kA
map_Ns

newmtl DeckWood
Ka 0 0 0
Kd 1 1 1
Ks 0 0 0
illum 2
Ns 8
map_Kd HULL-FRONT.png
map_bump
bump
map_opacity
map_d
refl
map_kS
map_kA
map_Ns

newmtl Aluminium
Ka 0 0 0
Kd 1 1 1
Ks 0.772549 0.788235 0.803922
illum 2
Ns 16
map_Kd HULL-FRONT.png
map_bump
bump
map_opacity
map_d
refl
map_kS
map_kA
map_Ns

newmtl MetalSemi
Ka 0 0 0
Kd 1 1 1
Ks 0.772549 0.788235 0.803922
illum 2
Ns 16
map_Kd HULL-FRONT.png
map_bump
bump
map_opacity
map_d
refl
map_kS
map_kA
map_Ns

newmtl Lights
Ka 0 0 0
Kd 1 1 1
Ks 0 0 0
illum 2
Ns 8
map_Kd HULL-FRONT.png
map_bump
bump
map_opacity
map_d
refl
map_kS
map_kA
map_Ns

newmtl Flag
Ka 0 0 0
Kd 1 1 1
Ks 0 0 0
illum 2
Ns 8
map_Kd HULL-FRONT.png
map_bump
bump
map_opacity
map_d
refl
map_kS
map_kA
map_Ns
[/java]

Okay. I jumped the gun on this one, it appears that my .mtl file was missing URLs to texture files on some of the maps. In addition, the file was structured differently than what the result was when exporting .3ds to .obj from 3DS MAX 14. For future reference to those that google stumble into this thread, if you have the exception above, make sure you export from 3ds to obj using a newer version of 3ds. It works with the trial version.