Blender + Vehicle

Hey guys!!!

I export my simple car Blender to Ogre, and i’m trying use the TestFancyCar.java.

I used the code and Ferrari model and it’s works very well, but when I try to use my model there are some errors:

Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main]
java.lang.NullPointerException
at mygame.Main.buildPlayer(Main.java:145)
at mygame.Main.simpleInitApp(Main.java:83)
at com.jme3.app.SimpleApplication.initialize(SimpleApplication.java:226)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.initInThread(LwjglAbstractDisplay.java:130)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:207)
at java.lang.Thread.run(Thread.java:744)

That’s your code. We can’t debug your code without seeing your code.

    //Load model and get chassis Geometry
    carNode = (Node)assetManager.loadModel("Models/classroom/car.scene");
    carNode.setShadowMode(ShadowMode.Cast);
    Geometry chasis = findGeom(carNode, "car");
    BoundingBox box = (BoundingBox) chasis.getModelBound(); (That's line 145)

Then chasis is simply null.
Hint: When you perform actions like that (or getControl() or or or) always do a simple check:

if (chasis == null)
{
    System.out.println("Error: Chassis is null, please fix the model classroom/car.scene");
    return;
}

That’s the way I do it all the time.

Open your model in JMP (SDK)'s SceneExplorer (right click and open in SE), then open the SceneExplorerWindow (it’s a sidebar, or found under Windows->SEW). There you can see the SceneGraph of your Model, I bet it’s not car but the name you gave it in blender (maybe car in your language)

Perfect… it’s works. Thanks!!!

1 Like