LoadAnimB3D and Molebox (Warning: Bizarre)

BlitzMax Forums/MiniB3D Module/LoadAnimB3D and Molebox (Warning: Bizarre)

Sledge(Posted 2007) [#1]
I'll try to describe this quirk as briefly as possible -- it's kicking my ass at the moment.

I have a 'maps' directory in my current project that contains level maps in .b3d format along with their textures. What I 'm finding is that, when I Molebox the project, the geometry will load fine but the textures won't UNLESS I store the maps and textures in the main directory instead (which is obviously a bit impractical).

I have narrowed things down a little in that, when employing a 'maps' directory, sticking the original (unpacked) directory in with the packed exe means the textures load again. So even though LoadAnimB3D is getting the geometry from the packed file it is deciding to search outside of the pack for the textures. What's really odd is that using Readdir() on the packaged 'maps' directory reveals that Max can find everything that should be there - not just the .b3d but the textures too!

I've been tracing back through the MiniB3D source and trying to work out why Readdir() can find things that LoadAnimB3D can't and I've got as far as FileFind and its by-reference arguments, which are new to me, so while I go and read up on that and try to work out what it's doing I thought I'd post. Any suggestions welcome* -- I'm fairly perplexed.



*I should point out that I've stripped out the hard-coded texture paths that Maplet puts in .b3d exports, so that's not the problem (in the unpackaged project the textures really do get loaded from whichever sub-directory the .b3d files are located in).


popcade(Posted 2007) [#2]
Yes, MoleBox doesn't support directory seeking/reading, personally I load texture and apply to my model when I'm still using B3D, dunno if MiniB3D has similar method to work out.


Sledge(Posted 2007) [#3]
directory seeking/reading

I assume that 'directory seeking' is a specialised sub-process that the mesh loader attempts? (EDIT: Oooh, is this a Filetype() issue I wonder...) I can manually load textures from the packed directory so it should be theoretically possible to 'fix' the mesh loader to do likewise.

Loading and applying the lightmap manually is fine (as there is only a single texture for the entire texture index) but I have no idea how to do the same for the material textures as they need to be mapped correctly about the mesh.


Sledge(Posted 2007) [#4]
I have happened across a solution to this problem which is just as bizarre: If I include an empty 'maps' folder in the exe's folder then all the contents of 'maps' within the pack can be found by the b3d loader! That'll do me!