PDA

View Full Version : how to use MTL files?



leoitch
04-28-2015, 10:23 AM
hi,
i got a free obj mesh from the net and it came with a mtl file. when i load the obj in modeler i can't see any textures on the model.

how do i get the mtl file applied to the model? sorry if this is a silly question.

tnx.

MSherak
04-28-2015, 02:21 PM
Just make sure the textures, .obj and .mtl are in the same folder and it will find everything. Then once loaded into modeler save as .lwo.


-M

leoitch
04-28-2015, 08:20 PM
hi MSherak,
yes, everything is in one folder on my desktop. i opened it and saved as lwo but still the textures does not show. am i doing something wrong?

meshpig
04-29-2015, 01:24 AM
... textures in the same folder too. With the .lwo you'll have to load them manually.

leoitch
04-29-2015, 02:52 AM
meshpig,
yes, everything in same folder...jpeg, mtl and obj files.

if i load the textures manually, what does the mtl file do?

meshpig
04-29-2015, 03:22 AM
it's just the property file, so to speak for the materials. Hence "mtl"... like the "fbm" folder for FBX.

leoitch
04-29-2015, 08:23 PM
meshpig,
ok. tnx much.

MSherak
04-29-2015, 11:41 PM
meshpig,
yes, everything in same folder...jpeg, mtl and obj files.

if i load the textures manually, what does the mtl file do?

The mtl file makes sure that the surface names come over and assigned to the polygons. You will still have to load the textures and assign manually them under the T button since OBJ importing does not do that for you automatically. So just load the textures, go under the T button and assign the UV and the texture to the surface.

-M

JohnMarchant
04-30-2015, 11:17 AM
If your having problems still. Mike Green had a good script to import .MTL files as well

3dworks
04-30-2015, 04:49 PM
you can simply open the MTL file in a code or text editor and if the object is not too complex, check if the texture paths and names are correct and actually correspond to what you have on disk. if the names are different, you can fix them in the text editor and resave the file. also make sure that the MTL file has exactly the same file name (but of course with MTL extension) as the OBJ file - usually programs save it as such. if the MTL file has a different name than specified in the OBJ it will be simply ignored by LW when loading the OBJ.

also you can open the OBJ with a text editor and make sure that you find in one of the first lines the name of the MTL file which need to be loaded. search for the line beginning with


mtllib name_of_the_mtl_file.mtl

where 'name_of_the_mtl_file' is obviously the name of this file.

hope this helps, let us know ;-)

cheers

markus