Importing models

I'd like to try JME3, I have in my JME2 application models built with 3dstudio and exported in 3ds format (then converted in jme format)

Which approach should I follow to use then (and create J3P archives)?

Thanks in advance

bye

You should import the 3DS models in Blender3D or your choice of modeling tool, and export them into Ogre3D Mesh.XML format. Sorry but this is the preferred way of handling models right now. In jME3, I've taken the necessary precautions so there's one, very well supported format, not many, badly supported ones.

thanks a lot, I did it, I exported from 3dstudio in to obj format, imported it in Blender and exported model in OgreFormat

the problem is that materials weren't red, except than for first one in .material file


30-gen-2010 18.57.26 com.g3d.asset.AssetManager <init>
INFO: ContentManager created.
INFO G3DSystem 18.57.29 Running on jMonkey Engine 3 ALPHA 0.30
INFO LwjglAbstractDisplay 18.57.29 Using LWJGL 2.2.0
INFO LwjglDisplay 18.57.29 Selected display mode: 640 x 480 x 0 @0Hz
INFO LwjglAbstractDisplay 18.57.29 Display created.
INFO LwjglAbstractDisplay 18.57.29 Vendor: NVIDIA Corporation
INFO LwjglAbstractDisplay 18.57.29 Renderer: GeForce 6200/AGP/SSE2/3DNOW!
INFO LwjglAbstractDisplay 18.57.29 Adapter: nv4_disp
INFO LwjglAbstractDisplay 18.57.29 Driver Version: 6.14.11.9562
INFO LwjglAbstractDisplay 18.57.29 OpenGL Version: 2.1.2
INFO LwjglAbstractDisplay 18.57.29 GLSL Ver: 1.20 NVIDIA via Cg compiler
INFO LwjglTimer 18.57.29 Timer resolution: 1000 ticks per second
INFO Camera 18.57.29 Camera created (W: 640, H: 480)
INFO LwjglMouseInput 18.57.29 Mouse created.
INFO LwjglKeyInput 18.57.29 Keyboard created.
INFO Node 18.57.30 Child (BitmapFont) attached to this node (Gui Node)
AVVERTENZA MeshLoader 18.57.30 Material 01_-_Default not found. Applying default material
AVVERTENZA MeshLoader 18.57.30 Material 03_-_Default not found. Applying default material
AVVERTENZA MeshLoader 18.57.30 Material arrivo not found. Applying default material
AVVERTENZA MeshLoader 18.57.30 Material sem2 not found. Applying default material
AVVERTENZA MeshLoader 18.57.30 Material asfalto not found. Applying default material
AVVERTENZA MeshLoader 18.57.30 Material carena not found. Applying default material
AVVERTENZA MeshLoader 18.57.30 Material Telaio1 not found. Applying default material
AVVERTENZA MeshLoader 18.57.30 Material Telaio2 not found. Applying default material
AVVERTENZA MeshLoader 18.57.30 Material Material__0 not found. Applying default material
INFO Node 18.57.30 Child (p-geom-1) attached to this node (p-ogremesh)
INFO Node 18.57.30 Child (p-geom-2) attached to this node (p-ogremesh)
INFO Node 18.57.30 Child (p-geom-3) attached to this node (p-ogremesh)
INFO Node 18.57.30 Child (p-geom-4) attached to this node (p-ogremesh)
INFO Node 18.57.30 Child (p-geom-5) attached to this node (p-ogremesh)
INFO Node 18.57.30 Child (p-geom-6) attached to this node (p-ogremesh)
INFO Node 18.57.30 Child (p-geom-7) attached to this node (p-ogremesh)
INFO Node 18.57.30 Child (p-geom-8) attached to this node (p-ogremesh)
INFO Node 18.57.30 Child (p-geom-9) attached to this node (p-ogremesh)
INFO Node 18.57.30 Child (p-geom-10) attached to this node (p-ogremesh)
INFO Node 18.57.30 Child (p-ogremesh) attached to this node (Root Node)
INFO LwjglMouseInput 18.57.39 Mouse destroyed.
INFO LwjglKeyInput 18.57.39 Keyboard destroyed.
INFO LwjglAbstractDisplay 18.57.39 Display destroyed.


I've update from svn revision 4801, and Asset class seems to miss (used in AssetCache)

truman said:

I've update from svn revision 4801, and Asset class seems to miss (used in AssetCache)



I've seen you added it in revision 4802 (thanks !!!), but  I think there's another problem when I try to loand an Ogre scene from a J3P file:
the method

private InputStream openStream(J3PEntry entry, String name, Access access)

always returns null and generates the exception:

3-feb-2010 19.59.41 com.g3d.asset.AssetManager <init>
INFO: ContentManager created.
INFO G3DSystem 19.59.47 Running on jMonkey Engine 3 ALPHA 0.30
INFO LwjglAbstractDisplay 19.59.47 Using LWJGL 2.2.1
INFO LwjglDisplay 19.59.47 Selected display mode: 640 x 480 x 0 @0Hz
INFO LwjglAbstractDisplay 19.59.50 Display created.
INFO LwjglAbstractDisplay 19.59.50 Vendor: NVIDIA Corporation
INFO LwjglAbstractDisplay 19.59.50 Renderer: GeForce 6200/AGP/SSE2/3DNOW!
INFO LwjglAbstractDisplay 19.59.50 Adapter: nv4_disp
INFO LwjglAbstractDisplay 19.59.50 Driver Version: 6.14.11.9562
INFO LwjglAbstractDisplay 19.59.50 OpenGL Version: 2.1.2
INFO LwjglAbstractDisplay 19.59.50 GLSL Ver: 1.20 NVIDIA via Cg compiler
INFO LwjglTimer 19.59.50 Timer resolution: 1000 ticks per second
INFO Camera 19.59.50 Camera created (W: 640, H: 480)
INFO LwjglMouseInput 19.59.50 Mouse created.
INFO LwjglKeyInput 19.59.50 Keyboard created.
INFO Node 19.59.51 Child (BitmapFont) attached to this node (Gui Node)
INFO Node 19.59.51 Child (Sky) attached to this node (Root Node)
java.lang.NullPointerException
   at java.io.Reader.<init>(Unknown Source)
   at java.io.InputStreamReader.<init>(Unknown Source)
   at java.util.Scanner.<init>(Unknown Source)
   at com.g3d.scene.plugins.ogre.MaterialLoader.load(MaterialLoader.java:285)
   at com.g3d.asset.AssetManager.loadContent(AssetManager.java:164)
   at com.g3d.asset.AssetManager.loadOgreMaterial(AssetManager.java:303)
   at com.g3d.scene.plugins.ogre.SceneLoader.load(SceneLoader.java:170)
   at com.g3d.asset.AssetManager.loadContent(AssetManager.java:164)
   at com.g3d.asset.AssetManager.loadModel(AssetManager.java:328)
   at it.F1Viewer3D.TestSceneLoading.simpleInitApp(TestSceneLoading.java:44)
   at com.g3d.app.SimpleApplication.initialize(SimpleApplication.java:124)
   at com.g3d.system.lwjgl.LwjglAbstractDisplay.initInThread(LwjglAbstractDisplay.java:110)
   at com.g3d.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:153)
   at java.lang.Thread.run(Unknown Source)



thanks a lot for your nice job !!!
bye

edit--

with this changes in J3PFile.java seems to work:

    private InputStream openStream(J3PEntry entry, String name, Access access){
        try{
            InputStream entryChan = requestRange(entry.offset, entry.length);
            if ((entry.flags & J3PEntry.LZMA_COMPRESSED) != 0){
                // wrap with LZMA decomressor
                return new LzmaInputStream(entryChan);
            }else{
                return entryChan;
            }
        } catch (IOException ex){
            logger.log(Level.SEVERE, "Failed to open stream: " + name, ex);
        }

        return null;
    }
    private InputStream requestRange(long offset, long length){
        try{
            ByteBuffer bb = ByteBuffer.allocateDirect((int) length);
            channel.read(bb, offset);
            bb.clear();
            ReadableBufferChannel entryChan = new ReadableBufferChannel(bb);

            InputStream in = java.nio.channels.Channels.newInputStream(entryChan);
            return in;
        }catch (IOException ex){
            logger.log(Level.SEVERE, "Failed to open URL: ", ex);
        }

        return null;
    }