Milkshape 3d and stupid relative texturing issues!!!

Recommended Posts

Shamino    100
Okay, so MS3D has been plagueing me with idiotic relative texture paths!!! How can I automatically path to the model's texture file when no matter what the path stored in the file is relative to where it was saved when it was first created?!?! Do I have to open each of these files individually and redo the paths so they work for me? I mean cmon! I really don't want to switch from MS3D, it has a very nice setup, it doens't repeat vertices, etc etc etc... And it is free! What can I do? Right now I'm getting the texture path this way...
	for ( int i = 0; i < NumMaterials; i++ )
if ( strlen( Materials[i].TextureFilename ) > 0 )
else
Materials[i].Texture = 0;

This simply doesn't work, because the texture string path I'm getting from the file is always different, such goofy pathing issues!

Share on other sites
Endar    668
I've written a little filesystem. All it does it actually take in a filename and check a bunch of default directories for a file of the same name. When it gets it, it returns an open file. It wasn't too hard to do.

Share on other sites
Shamino    100
I'm thinking, since the milkshape file format DOES actually give me a final filename, it just has a ton of pathing attached to it, like so:

I can just cut off everything before the last / and just attach my own path to it..

So it will be sent to me in the form above

But I will load it in the form

mypath/Sword.bmp

Share on other sites
jpetrie    13157
That is a good way to do it.

As an aside, a path that is fully-qualified ("C:\whatever\etc") is "absolute" or "full," not "relative."