Advertisement

Milkshape3D loader

Started by November 06, 2007 01:58 PM
3 comments, last by settis 17 years ago
hi, I have a problem with the milkshape loader in tutorial 31. Well its not exactly a problem with the tutorial. If I load the model provided by the tutorial all goes well, but if I make my own model in milkshape (v 1.7.8) it only loads the model -> without textures (model is white). Is there a special way how to create a milkshapemodel with textures for this loader? Is this the reason?: if ( pHeader->m_version < 3 || pHeader->m_version > 4 ) return false; // "Unhandled File Version. Only Milkshape3D Version 1.3 And 1.4 Is Supported." mfg
Milkshape is old, do anyone use milkshape3d nowadays :)

Well from what i remember I think the version checking would terminate the milkshape loading, thus no object should have been loaded then.. but if you got the model with no textures i suspect that the version is correct, but the texture-loading is not. I think older versions of Milkshape exported the absolute path + filename, you should probably check that the path points to the right texture file. And its also just bitmaps allowed using the Nehe example.
Advertisement
well, i think its strange -> i downloaded the lesson once again
(ran the .exe - everything alright)
and opened the model provided by the tutorial. Then I changed
the material so that no texture is used and saved -> ran the .exe,
the model was white as expected (no texture). I opened the model
agian selected the provided texture again and applied it to the
model (in milkshape i see that the model is textured) saved
ran the .exe again but the model remained white.

dont know what i do wrong (i also tryed a loader for .3ds files -
it was exactly the same)

(thx for reply)
Okey, I checked my source code now. It looks like I made a fix for this in my code. I basically removed the absolute path and returned the filename.

char* texName = strrchr(pMaterial->m_texture ,'\\');
if(!texName)
texName = strrchr(pMaterial->m_texture ,'/');

And then I used texName for texture loading. I suspect this will fix your problem. You can probably check the contents of the working milkshape file and the contents of the new one not working. I'll bet you can see some changes in the path specified for the textures.
thx, =)
it worked, now i can finally load my models

This topic is closed to new replies.

Advertisement