assetManager refuses to locate assets

I recently updated my jME through the Game Development Environment, but now whenever I try to load a model, I get a NullPointerException. The assets are located within a sub-directory of the standard “Models” folder in Project Assets (jMonkeyProjectsassetsModels) but the assetManager won’t find them.

Did you create the project with jMP in the first place? It worked before and after updating you get the problems? Does it work when you open the model in the jMP viewer? Can you post the complete error output that gives you the nullpointer?



Cheers,

Normen

I created the project with jMP before I updated and it worked as it should. The model also looks correct in the jMP viewer. As for the error message I get a popup window saying "The instruction at X referenced memory at Y. The memory could not be “read”. and the application output says:

“Sep 30, 2010 5:27:56 PM com.jme3.app.Application handleError

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

java.lang.NullPointerException

at com.chronicles.models.Worgen.loadModel(Worgen.java:55)

at mygame.Main.simpleInitApp(Main.java:62)

at com.jme3.app.SimpleBulletApplication.initialize(SimpleBulletApplication.java:261)

at com.jme3.system.lwjgl.LwjglAbstractDisplay.initInThread(LwjglAbstractDisplay.java:102)

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

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

Java Result: -1073741819”



Where “Worgen” is the class the Main refers to for a method which loads an Ogre XML model, attaches it to a PhysicsCharacterNode and then returns the created “character.” Line 55 is:

[java]Spatial model = assetManager.loadModel(“Models/Worgen/Mesh.mesh.xml”);[/java]

Oh, you try to load the mesh.xml file in your game. Ogre models are not included in the distribution assets jar file as mentioned in the manual. Try doing it the recommended way, converting the model in jMP to j3o before and then loading the j3o in the game. You can also modify your assets excludes in the project settings to not explude ogrexml files for development testing but for release games you should definitely use the j3o format.



Cheers,

Normen

I’m still unsure of what exactly is happening, since I re-installed jMP on my other computer, updated it, loaded the project and now it works just fine. It might be some little hiccup in the way the assetManager works after a recent update or something along those lines.