Importing a wavefront OBJ - or: What is an MTL file?

I imported a spaceship into the Cryengine Sandbox 3 Editor and exported it to a wavefront OBJ file, which also created a same name MTL file, which seems to deal with the textures (I know nothing of wavefront). The OBJ is 213 MB of text.

Then I went into blender, imported the OBJ. It also went for the MTL but complained it could not import more than 18 textures (which seems extremely low to me?). I looked at the MTL and it is a textformat as well, naming all kinds of textures/maps (diffuse, specular, normal) and other settings (?). I unpacked the textures from the PAK file over in the cryengine. The path was matching what was in the MTL file, but the MTL specified them as TIF files, the ones in the .pak were .dds (why does it use tif then when I export in Cryengine?).

At first I saw nothin in Blender, then tried importing with the “restrict size” thingy for imports … set it to 10, without any idea what I’m doing. After fiddling with recalculating normals etc I eventually had the model in Blender, but strangely far off the “center” point, so I had to move the geometry to the median first (why is it outside even?).

Also, the model had 1.2 Million vertices, of which 400’000 were gone after a “remove double”. In the end, I could apply some materials to it and render it etc.

But my real questions:

I can’t seem to import the MTL file properly? I get this too many textures error

and

Where’s the UV map information for the textures if they should load? In the MTL file as well somehow? Or rather: How do all the textures end up where they should? Retexturing such a big model by hand is … tedious and close to impossible for a newbie like me.

and

How does the import functionality create textures if I want to use the cycles renderer? I mean it doesn’t exactly know what nodes to use to recreate the original texture? I can only see it use the three maps in a basic tetxure node setup…

Short answer: Don’t rely on a .mtl file to work very well in Blender. Blender’s material system is different enough from most others that results will be sketchy at best. You may get your textures loaded correctly with Blender internal, but it’s going to be next to useless for Cycles. You don’t load it separately either, it’s automatically read in alongside the .obj on import if you choose it to be in the settings.

A single material can have a maximum of 18 textures


Yes it autoreads … it seems to try to attach mroe than 18 to a material then and fails … which is why I renamed the mtl, so only the object loads … at least, that works. Thanks for the clarifications!