texture problem

Started by fireside, April 30, 2009, 05:21:31 AM

Previous topic - Next topic

fireside

I haven't loaded any models into my game for quite a while.  I went to make a change and for some reason the model doesn't get a texture anymore.  I'm using the same code and I double checked and I know the texture is being loaded by jpct without error.  But when assigning material I get this line:

Processing new material Nonebrown.jp!

The texture line is:

        TextureManager.getInstance().addTexture("brown.jpg", new Texture(this.getClass().getClassLoader().getResourceAsStream("brown.jpg")));


I copied the same name and it shows in my models folder as brown.jpg.

I'm using the same version of Blender which was working fine.

The 3ds load is:
        Object3D box1 = loadModel("testC.3ds", 20);
        world.addObject(box1);


The same one I'm using for at least one textured model which is working properly, but now my exported models don't seem to work anymore. 
click here->Fireside 7 Games<-

EgonOlsen

Have you verified that your texture name is really correct? Loader has a method to extract the texture names from a 3DS. Use that on your model to see what is the exact name.

fireside

#2
This is what I tried:
        String[] modelTextures = Loader.readTextureNames3DS(this.getClass().getClassLoader().getResourceAsStream("testC.3ds"));
//        System.out.println("Texture for testC = " + modelTextures[0]);


The commented out line just gives an array index out of bounds, but when it does the material thing for the model it says Nonebrown.jp, so it must be reading the file name.

Edit: I got the test cube to work by applying a material to the model.  I don't remember doing that before but maybe I forgot or something. I thought I was just applying a texture in the image editor before.  I'll have to see if this works for transparency yet.

Another edit: Transparency works, too.  Apparently I forgot about the material.  Now I can get back to my buggy code.
click here->Fireside 7 Games<-

Melssj5

I guess is due to the name of the texture file

Nonebrown.jp

12 chars

3DS files stores texture names in 8.3 format

inside the map, the referenced texture name is Nonebrown.jp but the file is Nonebrown.jpg

Nada por ahora

fireside

The "None" was added by jpct, apparently because it couldn't find it or something.  The name of the texture is simply brown.jpg, unless Blender added that to the name for some reason.
click here->Fireside 7 Games<-

EgonOlsen

Name of the material !=  name of the texture. They are read from different chunks from the file at different sections in the code. I'll check for that "None..."-thing. I don't think that jPCT adds this...

EgonOlsen

I've checked it out and there is no code in jPCT that adds a "None" to a materials name. The name is taken directly from the file as a series of bytes, read into a fresh instance of StringBuffer and convertedto the name of the material. There's no "None" added anywhere...