ASE loading problem

Hi all,

I just started fiddling around a bit with Java-based 3D programming and am currently sort of “evaluating” scenegraph libs and the likes.

So I tried to write a very simple app to learn a bit about the programming model behind jme and got immediately stuck on a problem.

While loading a simple ase-file without textures, I keep getting an ArrayIndexOutOfBounds Exception at com.jme.scene.model.ase.ASEModel.convertToTriMesh( (btw. I checked out the jme head).

It looks as if the assumption that there is a tempTexVertex at object.faces[j].coordIndex[0] is wrong, since my ase file contains *MESH_NUMTVERTEX 0, so the vector does get initialized to size 0.

I tried to simply implement a check, whether this array index is valid but then I get stuck with a NullPointerException at some other place.

Am I doing anything stupidly wrong here or is this some kind of bug?

BTW., here’s my notsodifficult source:

protected void simpleInitGame() {

display.setTitle(“A Simple Test”);

ASEModel model = new ASEModel(“sphere”);

URL data = JmeEval.class.getClassLoader().getResource(“half.ase”);




in a class which extends SimpleGame.

The model loaders are probably our current weak point, so it may be a bug therein. If that is the case though, the good news is that Mojo has said he will be focusing on greatly expanding the ASE loader for .7.

That said, it would be a great help to have a copy of your non-working model to test. Could you post a link to it?

Yes, I can :wink:

Here we go:

Fairly simple this is half of a sphere with no texture.

Improving ASE and adding 3DS is my goal of the next release, so I’ll tackle issues with the current loader first. Thanks for the model, I’ll try to take care of these problems.

Well, having said that, I found a minor bug in the milkshape loader.

In the method private TextureState loadTexture(String file) you should add a test for an empty texture file string, since in models without textures these values are empty strings. You need to add this in the beginning of the method, since later on you create a fileURL by attaching this file name to the texture directory, so the fileURL is never empty but pointing to a directory instead of a file.

        if (file == null || file.trim().length() == 0) {
            return null;

Alternatively, in TextureManager.loadTexture you could check, whether the given file url really resembles a file and not a directory.

I'm not going to change things in CVS, I am way to n00b in jme still.

Thanks, the check has been committed.

It looks like there are still errors in the ASE loader.

I’m just trying to load a simple geosphere exported as ASE and it gives me the following:

INFO: Node created.

java.lang.ArrayIndexOutOfBoundsException: 0

at com.jme.scene.model.XMLparser.Converters.AseToJme$ASEModelCopy.convertToTriMesh(

at com.jme.scene.model.XMLparser.Converters.AseToJme$ASEModelCopy.load(

at com.jme.scene.model.XMLparser.Converters.AseToJme$ASEModelCopy.<init>(

at com.jme.scene.model.XMLparser.Converters.AseToJme.convert(

at jmetest.renderer.loader.TestASEJmeWrite.simpleInitGame(



at jmetest.renderer.loader.TestASEJmeWrite.main(

See also

I didn’t write that part of the ASE loader (not sure who did), so I can’t comment too much on it. It looks like it’s having trouble setting texture coordinates though from the source. Not sure if that gives you any clue on how to change your model to make it load.