Problem loading obj models

The problem was with DummyDisplaySystem, and not with TextureState itself. Update from the CVS and try again. You could also do this from some kind of command line running utility. I went to the console and executed the following command at the base jme CVS directory

C:Documents and SettingsMeIdeaProjectsjme>java -cp target/jme.jar com.jme.scene.model.XMLparser.Converters.MilkToJme src/jmetest/data/model/msascii/run.ms3d run.jme
Converting file srcjmetestdatamodelmsasciirun.ms3d to run.jme
Conversion complete!



The executed the following code to load the model.

public class LoadJme extends SimpleGame {
    public static void main(String[] args) {
        LoadJme app = new LoadJme();
        app.setDialogBehaviour(SimpleGame.ALWAYS_SHOW_PROPS_DIALOG);
        app.start();
    }

    protected void simpleInitGame() {
        URL textureURL=LoadJme.class.getClassLoader().getResource("jmetest/data/model/msascii/DM_Face.bmp");
        JmeBinaryReader jbr=new JmeBinaryReader();
        BinaryToXML btx=new BinaryToXML();
        jbr.setProperty("texurl",textureURL);
        Node r=null;
        try {
            r=jbr.loadBinaryFormat(new FileInputStream("run.jme"));
            r.setLocalScale(.1f);
        } catch (IOException e) {
            e.printStackTrace();
        }
        rootNode.attachChild(r);
    }
}



The reason I have to point to the texture directly rather than its URL is because classloader goes to the wrong places first trying to find the "correct" directory. In most cases, you'll just need the texture URL.

@Cep: ok, took me some time but i got it now.

thanks for your patience :slight_smile:



Martin

@Cep i check from pvcs and retry :



it’s ok now for obj and 3ds with texture for the conversion :slight_smile: great job !



but it doesn’t run for AseToJme (null pointer for setTexture) :’(



also i’ve got another pb, since DummyDisplaySystem has a private constructor, i am forced for the moment to put my swing layer in the same package. is it possible to make DummyDisplaySystem public ?.



thanks again for all your answers.



bye,



Adenthar

Update CVS and Try again. I changed something in AseToJme. DummyDisplaySystem is now public as well.

It runs perfectly now ! :). I think my Swing ui for converters will be ready in a few days.



Thanks a lot for this update and for all this great work.



Adenthar.