AssetNotFoundException

hi,



i got a problem with a model that i want to load in my game. on my other computer it runs perfectly, but when i got my new one i get an error at:



[java]

Spatial test = main.getAssetManager().loadModel("Models/tree.obj");

[/java]

the error code is:

[java]

Schwerwiegend: Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main]

com.jme3.asset.AssetNotFoundException: Cannot find material tree.mtl for model Models/tree.obj

at com.jme3.scene.plugins.OBJLoader.loadMtlLib(OBJLoader.java:330)

at com.jme3.scene.plugins.OBJLoader.readLine(OBJLoader.java:384)

at com.jme3.scene.plugins.OBJLoader.load(OBJLoader.java:573)

at com.jme3.asset.DesktopAssetManager.loadAsset(DesktopAssetManager.java:243)

at com.jme3.asset.DesktopAssetManager.loadModel(DesktopAssetManager.java:376)

at com.jme3.asset.DesktopAssetManager.loadModel(DesktopAssetManager.java:386)

at mygame.map.Map.addTreeTest(Map.java:113)

at mygame.map.Map.generateTerrain(Map.java:109)

at mygame.GameManager.executeCommand(GameManager.java:114)

at mygame.views.Singleplayer.mouseEvent(Singleplayer.java:86)

at mygame.GameManager.mouseEvent(GameManager.java:220)

at mygame.Main.onMouseButtonEvent(Main.java:91)

at com.jme3.input.lwjgl.LwjglMouseInput.update(LwjglMouseInput.java:124)

at com.jme3.input.InputManager.update(InputManager.java:831)

at com.jme3.app.Application.update(Application.java:567)

at com.jme3.app.SimpleApplication.update(SimpleApplication.java:235)

at com.jme3.system.lwjgl.LwjglAbstractDisplay.runLoop(LwjglAbstractDisplay.java:149)

at com.jme3.system.lwjgl.LwjglDisplay.runLoop(LwjglDisplay.java:185)

at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:223)

at java.lang.Thread.run(Thread.java:722)

[/java]



i really have no clue why it doesnt find the mtl file. i hope someone can help me.



Thx for your answers.

Isn’t the problem is obvious from the error?


Cannot find material tree.mtl for model Models/tree.obj


the material file of the model file is not found. See if its there.

both files are in the same directory. there is also nothing wrong with the file itself because its running on my other pc.

does no one have a clue ?

Are you using the SDK or Eclipse?

wizz07 said:
does no one have a clue ?

Please don't bump within one hour :roll: Next bump like this will be deleted comment-less.

when you say “on my other computer it runs perfectly”, are you compiling it there or running the file from the dist folder? if its the latter you need to use .j3o, if not then idk

yes sry for bump and thx for the replies, but i got the error.



i was using an older version of jme3 on my older pc, where you didnt need the textures for a model to load. it just showed up in blank grey. in the new version you get the error when loading it without the textures in the same folder. now i got the problem that its showed in black, but i now how to fix it with the recalculate normals inside in blender. i just have to find the function cause shift+ctrl+N doesnt work for me :slight_smile:

I am having similar issues so could u please tell me how u load it with textures from Blender?? and how did u manage to get it running with the right material?



thanks

Interesting…



This is the exact issue I was trying to fix. It is making life difficult… I tried re-exporting the models without the material file, as I really don’t need the actual material, just the UV mapping coords. This worked in some cases and didn’t in others. Geometries are now appearing and disappearing depending on the rotation of the camera.



What video card are you (anyone having this issue) using?

Are you using lighting.j3md as your material?



What process did you use to “re-export” them?

@pspeed I am using Lighting.j3md as the material that I apply post-model-loading.



And when I re-exported the model from blender, I turned off the texture in the material… so when I converted it to a j3o, it sets the default material to unshaded. I have no clue whether this is what I want to do… as it seems a bit hack-ish, but I’m really unclear as to what else I could do (I’m not overly blender-literate unfortunately)

My guess is that your model ends up without normals when you do it that way. It’s one possible cause of the problems you see.



Another approach you could take would be to export them fully materialed from blender, import them into JME as a fully materialed .j3o and then remove the material and resave it.

@pspeed Just to clarify, remove the material using the scene composer, yes? This would be an ideal solution… and as soon as I am done uploading a video showing the issue, I’ll give it a shot and see how it works!

Do you guys have any advice on how to do it using Eclipse?



To avoid cross posting my code and the issue in detail is on: http://hub.jmonkeyengine.org/groups/general-2/forum/topic/importing-from-blender-issue/?#post-161804