How to open or use mtl. files
johnbuckeridge
Posts: 295
in New Users
Hi everyone. A lot of the freebie models I come across on the web are in obj. + mtl. formats. I know how to use obj files, but the mtl. files that come with them - which are pretty essential - I don't seem able to make use of. A search on Google tells me lies! That Photoshop will open them, but it doesn't. What I'd like to do is convert them to either jpg or png files so I can use them. Any ideas? Or can you point me towards a tutorial? Many thanks. :)
Comments
MTL, as far as I understand it, is basically just a list of references to parts of geometry and image maps. MTL files are SUPPOSED to load with the OBJ, but DS doesn't seem to do it very reliably. Have you tried open an MTL in a text editor?
theyre fairly useless.
but if you insist,open them in a basic text editor
mtl files are not texture maps.
they (try to) direct the software how to assign different textures maps and shader values to surfaces of the obj. All of this can (and should) be done manually so .mtl is not necessary.
They are applied automatically when opening the .obj
only if they are in the same path as the .obj and only if you have 'read material library' checked on the import obj dialog box.
Thank you for your input, everyone, I've learned a few things here. Yes, Lilweep, I thought they were texture maps. Ascania, when you say they are applied when opening the obj - do you mean opening it/them in DAZ Studio?
Okay, so I've just checked that - 'read material library' seems to be checked by default on my set-up, but how would you if the mtl. files are/ are not in the same path?
Put them in the same folder.
Is it imperative you read the .mtl file? I said this before and I'll say it again, mtl file is not some fool proof way of applying shader settings in Daz Studio, and doing so will often mess up your shader settings or otherwise will not apply maps correctly or omit maps
You can just set up the surface settings manually, under Surfaces tab. Drag/drop the texture maps into the relevant the slots on the shader, takes 5 seconds for simple PBR shader set up
Or may other programs that can read .obj models.
I hope this isn't a doofus question but... what is the relationship (if any) between an .MTL file and a UV map, or UV mapping in general.
They're related only inasmuch as they both concern texturing. A UV map tells the program which polygons on your geometry should take which pixels of the texture map. An MTL file applies textures to corresponding surfaces on the OBJ, so as long as the OBJ is UV mapped (which it should be before export), there won't be any issue.
Thanks for entertaining my question. Okay, so if an object should be UV mapped at the source, or at the time of creation, why are there after-the-fact, "standalone" programs such as "UV Mapper"?
becuase the word you used 'should' doesnt mean it always is, and doesnt mean it is made perfectly and to the specifications of the user, so they may want to change it.
Because back in the day most modeling programs were crap at UV mapping, basic maps were about their limit, programs like UV Mapper and Lithium Unwrap allowed you to fine tune the UV coordinates of any mesh.
This does not work for me. I export the file from Blender with the textures mapped and the .mtl file in the same as the Obj file. It imports into Daz Studio completely white with no maps at all.
You can easily open .mtl file to check if the path / files of texture maps are correctly saved within ~~ but beforehand:
1) unpack resources in Blender to make sure texture files are physically locate on your disk.
2) make sure there's no "space character" in the file of .OBJ as well as .mtl. otherwise they won't work for loading map files.
Be noted, only Diffuse maps can 100% correctly loaded with .mtl file, you have to check maps in other slots and correct the assignment manually. (bump, normal, roughness, etc.)
If you want to create jpg or png files, while in blender, view the object in the layout tab with viewport shading applied. If the object looks correct then switch to the UV Editing tab. There you will see one of the textures applied to the UV map. Under the image tab, choose Save as and choose a file format and save to a convenient spot. Repeat this process using the carrot alongside the name of the file shown to toggle to the next texture name and Save as. Create a folder inside your textures folder in Daz and copy the files to it. Use the surfaces tab in Daz to apply the textures to your object.
DS has two ways to import OBJ.
First is through File/Import, this allows you to load it from any where on your system, with this pathways in the MTL need to be the full pathway including drive letter.
Second is using the Content Library tab, by setting up an "Other Formats" content directory, with this pathways just need to start from the location of the MTL file.
And drag and drop.