Problem importing blender mesh

Newbie here. Using Vista, Blender 2.5/9/6(can try 2.49 if I have to), JME3 Export in Blender Ogre3D( .scene and .mesh) When I import model this message window pops up:

Error importing file!

(java.lang.NullPointerException)



I added OgreCommand line tools 1.6.2

Itried one of jmonkey trial samples as well but even a simple cube doesnt come over and I place a material just in case.

Thanks in advance

Pete

Now using Jmonkey alpha4, no better still having problem importing mesh. Must be something I’m doing wrong

Pete

Hi Pete,



I don’t know enough to help you with that problem, but have you tried loading straight out of the .blend??? Thats the method I’m using… might be a temporary solution for you until you get this sorted… (although I like the idea of working straight out of .blend rather than having to export meshes and all that).

PS. this topic may help you if you go down that path (or it might not too…):



http://hub.jmonkeyengine.org/groups/general-2/forum/topic/cant-get-a-spatials-animcontrol/

Did you updated JMP with nightly builds?



Try to load only one cube with a simple material. Without lights and bones.

Thanks for the responses. But following tutorials and still cant import models even following tutes.keep getting errors.And I’m unsure how to load blend files is there a dummies tute.Ogre seems to be working, seems to save files ok. I loaded command line tools but. any direction will be helpful. Believe it or not I’m checking everything people show me.

I’ll keep trying

Pete

… alpha-4 only works with blender 2.49 and the supplied export script (Tools->OgreXML). When you update to nightly (outlined in the manual) you can use blender 2.5+ with the export script under Tools->OgreXML. Its all outlined in the manual, under “importing models”.

Pete,



There must be something somewhere about how to load .blend, as I obviously learnt it somewhere. But i can’t for the life of me remember where. A quick search might help.



But, try the following. If this doesn’t work, there is something funny going on.


  1. Create a new BasicGame in JMP.


  2. Open blender. Don’t do anything. Just save the default cube as a .blend. Save it, or copy it to the project’s Asset folder, preferrably in the subfolder named “Models”. (This will be somewhere around “Documents/jMonkeyProjects/BasicGame/assets/Models”, where ‘BasicGame’ is the name of the project you just created in JMP.


  3. Put the following code in your Main.class. Sorry if I’m teaching you to suck eggs, but note the imports, in particular com.jme3.scene.;. Also any reference to “cube.blend” should be replaced with the name of the .blend you created in step 2.



    [java] package mygame;



    import com.jme3.app.SimpleApplication;

    import com.jme3.material.Material;

    import com.jme3.math.ColorRGBA;

    import com.jme3.renderer.RenderManager;

    import com.jme3.scene.
    ;







    public class Main extends SimpleApplication {



    public static void main(String[] args) {

    Main app = new Main();

    app.start();

    }



    @Override

    public void simpleInitApp() {



    //Load the model from cube.blend

    Spatial cube = assetManager.loadModel(“Models/cube.blend”);



    //Create a new material for the cube

    Material mat = new Material(assetManager, “Common/MatDefs/Misc/Unshaded.j3md”);



    //Set the colour of the cube.

    mat.setColor(“Color”, ColorRGBA.Blue);



    //Apply the material to the cube

    cube.setMaterial(mat);



    //Attach the cube to the root node, making it visible

    rootNode.attachChild(cube);



    }



    }

    [/java]



    If all is done correctly, when you run the project, you will see a blue cube at the center of the screen, loaded directly from your .blend.



    Hope this helps.



    EDIT: Follow normen, not me. He knows best.

you need to install the blender support plugin to use blender files directly i think.

wezrule said:
you need to install the blender support plugin to use blender files directly i think.

To use blender models like @nerb outlined, you just need to update to nightly (Manual). But loading .blend files directly in game doesn't make much sense, the import process is way too elaborate. Hence you should then install the "Blender Support" plugin so you can convert .blend files to .j3o in the SDK. Note however that blender import is a work in progress and that OgreXML is the preferred way still at the moment.