Can't import house model from 3D Studio Max 8


Can't import house model from 3D Studio Max 8. Even if I save the model in max or 3ds extension. I use the example below:
//package jmetest.renderer.loader;

import com.jme.app.SimpleGame;
import com.jme.scene.Node;
import com.jme.math.Vector3f;
import com.jme.math.Quaternion;
import com.jme.math.FastMath;
import com.jmex.model.XMLparser.JmeBinaryReader;
import com.jmex.model.XMLparser.Converters.MaxToJme;

import java.io.*;
import java.net.URL;


/**
* Started Date: Jun 26, 2004<br><br>
*
* This class test the ability to save adn write .3ds files
*
* @author Jack Lindamood
*/
public class TestMaxJmeWrite extends SimpleGame{
    public static void main(String[] args) {

        TestMaxJmeWrite app=new TestMaxJmeWrite();
        app.setDialogBehaviour(SimpleGame.FIRSTRUN_OR_NOCONFIGFILE_SHOW_PROPS_DIALOG);
        app.start();
    }

    protected void simpleInitGame() {
        try {
            MaxToJme C1=new MaxToJme();
            ByteArrayOutputStream BO=new ByteArrayOutputStream();
            URL maxFile=new URL("file:/D:/house.3DS");
            C1.convert(new BufferedInputStream(maxFile.openStream()),BO);
            JmeBinaryReader jbr=new JmeBinaryReader();
            jbr.setProperty("bound","box");
            Node r=jbr.loadBinaryFormat(new ByteArrayInputStream(BO.toByteArray()));
            r.setLocalScale(.1f);
            if (r.getChild(0).getControllers().size()!=0)
                r.getChild(0).getController(0).setSpeed(20);
            Quaternion temp=new Quaternion();
            temp.fromAngleAxis(FastMath.PI/2,new Vector3f(-1,0,0));
            rootNode.setLocalRotation(temp);
            rootNode.attachChild(r);
        } catch (IOException e) {
            System.out.println("Damn exceptions:"+e);
            e.printStackTrace();
        }
    }
}

I can't import even in a 3DmonkeyWorld editor. Although I can import pretty old models which are made with some older 3D Studio's.

Just for kicks give com.jmex.model.util.ModelLoader a run and load your model with that and see if it makes any difference?



I can't find that class in jme0.1

I'll assume you're not running the latest build from CVS then?  You really might consider doing so.  Very rarely do any instabilities get introduced into the repository, and if they do the developer is scourged accordingly.

if you get the cvs version you can export to collada with feelingsoftwares collada exporter for max 8 too…


Finally I must confront with CVS. Could I use it through the NetBeans or I must download WinCVS ?

Thank you. I will try ModelLoader first, than I must investigate collada. As I glance over it is universal 3D extension. Does plugins for exporting from 3DSMax are free ?
SlavoniaJavaTeam said:

I can't find that class in jme0.1


just to make it clear: jme v0.1 != jme v0.10

edit:typos (as always - you don't want to chat with me! you wouldn't understand half of the things i'm typing  :P )
SlavoniaJavaTeam said:

Finally I must confront with CVS. Could I use it through the NetBeans or I must download WinCVS ?


NetBeans has CVS support, you just have to figure out how to use it. ;)

SlavoniaJavaTeam said:

Thank you. I will try ModelLoader first, than I must investigate collada. As I glance over it is universal 3D extension. Does plugins for exporting from 3DSMax are free ?


Yes, the Collada exporting plugin for 3DS is free.  You simply have to register on the site and then you can download it.

though, at the moment, our collada importer is not generated against collada version 1.4.1…


Wait wait wait. I need some explanations.
I think it is goes too far for me. I'm new with 3D in java and my english is not brilliant. I just want to see my newer 3DMax files as I saw the older one. To flow around the house models so simple with the 3Dmonkey packages.
1. Why I need collada importer, why I can't see the Max file as I saw my older 3DS files with the TestMaxJmeWrite example? If it TestMaxJmeWrite example is old, ok I will export with collada exporter.
2. I set NetBeans to: ":pserver:slavoniajavateam@cvs.dev.java.net:/cvs", got CVS version of jme, but half of jar files which I got in jME0.10 I don't have it (for example from target folder, it is full of jars in a 0.10 version).

The .3ds format is a bit obsolete, but if all you need to do is import a static house model, .3ds is probably fine for what you need (i.e. MaxJmeWrite will work).



However, once you start doing more complex modeling, skinning/animations, etc, you'll want to get away from .3ds and move to something like the Collada importer.



As Mr. Coder mentioned it doesn't yet support 1.4.1 which was just released, so be careful with the exporter you get from feeling soft. We'll support it sometime, but at work we use a custom exporter and don't have a need to move up to 1.4.1 yet.

But I tried to import static house models in TestMaxJmeWrite. It works with the previous 3DStudio files but not with the 3DStudio Max 8. But it doesn't matter, I will try collada. I suppose that CVS version have collada example ?

Second quesition is: why CVS version don't have all jar files what jME0.10 have (jme-sound.jar, jme-terrain.jar,jme-scene.jar…). I thought that with CVS I got the latest version of jME. I get CVS version through the NetBeans and checkout jme only.

I download collada plug-in for 3DMax, 1.0.6 version. Does I get compatibile format for using with jMonkey engine ?

Sorry because "Does I get".


> Do I get.

Yes !!!
TestMaxJmeWrite finally works with CVS version. Although still don't have it textures, but I didn't copy missing jpg into working directory. Anyway guys, I love java and I saw many beautifull thiings in java world, but I think that is 3DMonkey is the one of the most excited.

So, is there any way to export Collada-models from 3D Studio Max 8 with a publicly available plugin that are compatible with jME? Version 1.06 of the plugin from Feeling Software exports Collada 1.4.1, so I guess it's useless until we get support for 1.4.1 in jME…?



Regards,



Per

Has anyone tried 1.4.1 with our importer, or are we just assuming?

When I try to load a model exported with ColladaMax 1.06 I get "Unable to load Collada file. Value of VersionType is invalid." I assume this is normal since 1.4.1 is an unsupported version of Collada…?



If I comment out the line of code that checks the version however, the model seems to load but I can't see it. This could be due to its location in 3d space though, I don't know. I'm a newbie when it comes to 3d models and loading them in jME.



Here is some of the debug log:



INFO: Child (golf5p_max) attached to this node (model)

batch: chrome-mesh: Batch 0 old: 10026 new: 2755

batch: glassblk-mesh: Batch 0 old: 582 new: 237

batch: tyre-mesh: Batch 0 old: 8184 new: 1852

batch: backlght-mesh: Batch 0 old: 1788 new: 479

batch: braklght-mesh: Batch 0 old: 156 new: 66

batch: fronlght-mesh: Batch 0 old: 312 new: 102

batch: wheel-mesh: Batch 0 old: 27612 new: 7612

batch: interior-mesh: Batch 0 old: 1446 new: 430

batch: glass-mesh: Batch 0 old: 1224 new: 420

batch: plastic-mesh: Batch 0 old: 12867 new: 4163

batch: nplate-mesh: Batch 0 old: 240 new: 94

batch: body-mesh: Batch 0 old: 27168 new: 7553

batch: mirror-mesh: Batch 0 old: 228 new: 83

batch: rearlght-mesh: Batch 0 old: 216 new: 87

batch: black-mesh: Batch 0 old: 3426 new: 1648

batch: aluminium-mesh: Batch 0 old: 1584 new: 404

batch: turnlght-mesh: Batch 0 old: 714 new: 206

batch: inter_w-mesh: Batch 0 old: 5502 new: 1414

debug info looks good.  We probably should change the version check to look for 1.4+



Maybe try turning on bounds to see if you can find your model?