Question regarding model loading (3DS)

I have a 3ds model with jpg texture used.  The 3ds file and the texture exist in the same directory.  I can successfully load the 3ds file, but the texture only seems to load correctly when i put it in my working directory (generally the project root).  I have looked in the 3DS file, and the texture filename has no path attached (filename only).  I would expect that in this case, it would attempt to load the texture file from the same directory as the model file.  However, in looking at the code, it seems to create a simple URL of file:/<filename>.  Is there any way to get the behavior I expect, or will this only work when the textures are relative to the working directory?



–Ruab

That was exactly what I was missing.  I now see that those properties are described under the details section of the setProperty javadocs.  It might be worth promoting those comments up to the top level of the JmeBinaryReader documentation, so they are easier to spot.



Thanks!



–Ruab

You normally specify the url of the file you are loading with a property:

my3dsConverter.setProperty( "mtllib", url );


This causes the converter to search for material resources relative to the file you are loading.
Nearly the same goes for the jme binary reader for textures:

jbr.setProperty( "texurl", directoryUrl );


Where directoryUrl now points to base directory the textures reside in (probably the directory your model file resides in).