Obj's and mtl's?
Hello,
I often buy non-Daz products, sometimes made for other programs, like Vue, etc. but as long as they mention that an Obj version is included I don't mind, because Daz is capable of handling that basic format.
I keep the .obj, .mtl and all texture files in a single folder together - except then when I import the .obj's many of them load without textures. :shut:
Which means digging up the folder the textures are in and applying them manually, but also then having to figure out custom bump, transparency, displacement settings, etc. for every single surface.
I believe the .mtl file is supposed to do all this automatically? but I often find it doesn't, which is the problem.
If I've got it wrong then what is an .mtl file?
and is there a way to get the textures automatically / properly applied?
Thanks. :cheese:
Comments
Your correct that .mtl files are material files but the reality is that there is not perfect continuity across programs. While ideally it should at least load maps you would still end up fixing all the settings so that they looked right.
In theory, the program loading the OBJ SHOULD read the MTL file and load things so you dont have as much work to do. However, I cannot count the number of times that an OBJ saved out of Carrara does NOT show up in DS with any colour or maps, but then the next model will. Usally, I can use PoseRay to load the same file and export a new OBJ and DS will load it fine with colours and maps. Just my experiance!
Hi...
I agree with what both Khory and Mattymanx have said and my experience with OBJ and MTL files has always been hit or miss with any given App.
What I generally do is import into an App that it works in and can export usable files to the App I want to use. Although sometimes it could take running it though a few different Apps to reach it's final destination and I only do that if I reeeally want to use it...
Okay, thanks everyone.
I'll have to dig out Poseray again, and learn how to use it this time. :)
Nevermind. I misunderstood the OP.
mac
It can happen when the textures are not found in the path the mtl file points to. Just edit the mtl file and delete all path reference since you put them in the same folder
DS is actually reading the MTL, the problem is that the pathway to the texture in MTL isn't what DS needs it to be, most programs only save the texture name and can quite happily load the textures from the same folder that the MTL is in, DS however needs the full pathway including the drive letter before it can find and load the texture.
I should add that MTL's have even less usable surface info for us than we get from an MC6, so your probably better off loading the textures yourself.
I have a related question regarding mtl files
I did a capture from GTA San Andreas usind 3D ripper dx, the resulting texture maps were .dds format
converted them to .jpg and replaced dds with jpg in the mtl file but still will not load on the obj
and before some one posts with an irrelevant comment about mesh copyright BLAH BLAH BLAH ad nauseum
this is for personal use, no redistribution, prob no renders but I cannot promise that (posted a couple already), certainly not for commercial use, just fan art.
anyway a daz export getsa mtl file like this, example LB strawberry
the GTA one (jpg replacing dds looks like this
(partial extract, has 900+ textures!!0
so other than the # 's maybe, what must I change in notepad?
help, suggestions appreciated :)
I have tried without succes using find and replace to imitate the Daz example
Hi Wendy...
Well first off I'll have to admit that I never really bothered to learn the details of the MTL file :red: , but I do know my way around an OBJ
So I decided to have a read of the MTL file format specs and the one you posted as an example looks okay off hand. The # are for comment lines and make no difference on the workings of the file.
So as Takeo.Kensei and Bejaymac have said, the paths for the textures need to be correct.
From your example : GTA.obj , GTA.mtl and GTA.jpg would all need to be in the same folder
ie: folder/GTA.obj folder/GTA.mtl folder/GTA.jpg
or since the line that lists only the texture JPG and not a folder structure like the DS export does, the JPG files should just live in the same folder right next to the OBJ and MTL files
The only other thing that I could think of that may be a problem is in the OBJ if the material or surface grouping lines are named differently and not calling the MTL file.
Sorry if this was a bit on the confusing side, my brain tends to wonder that way when I thinking to much... anyway Maybe one of the others can further aid in this... :)
if I open the obj file in notepad, it is all in japanese! usually they are mathematical functions, symbols and stuff, the textures load ok manually, it is uv mapped but finding which of the 900+ images map to which surfaces rather daunting. I have tried them in the same folder as well as under maps.
Notepad is not a good viewer for OBJ's or MTL's in general. The formatting is horrid. Try Notepad++ or PSPad they keep the file formatting intact.
There are text lines in the OBJ and they name the matlib and surface groups. If the mesh has a large vert count the OBJ can be ten's of thousand of lines long. But a word search can find the lines quickly.
I'm not sure that the problem is in the OBJ though, it was a thought I was grasping at.
With 900+ maps matching those to the surfaces manually will be like doing one of those 1000 piece puzzles...maybe worse... and the OBJ and MTL file info won't be of any help in doing it.
So if the maps are in the correct relative paths according to the MTL file... I'm kind of back to square one with my earlier suggestion... :down:
Anyone else have an idea...
@Wendy : Your mtl file seems good to me. You don't have to bother with the # sign it's just the comment sign
There may also be some corrections to bring to the obj file as stated niccipb
At the beginning of the obj file you must have a reference to your material library used with the following declaration :
mtllib YOURMATERIALLIB.mtl
then it will also declare geometries and which material to use in your library for all declared objects or groups.
Look for "usemtl" in your object file and see if the material names match your mtl file.
I will have another look at it later (not on computer)
the reason I want to solve this is 3d ripper dx will grab mesh from any directX app and while it can only be for personal use I find it fascinating getting the objects into Carrara etc and playing with them, it is interesting to see how low poly they are and how complex scenes you see in games are basically cubes and transmapped planes.
This might help you. It's a quote from Rob Whisenant from some years back explaining how DS reads a .mtl file. I copied it at the time as being useful information.
mac
success! yay, happy dance
I exported the imported obj from Daz studio!!!!
then
Replaced the Daz studio mtl file with the original!!
with mtllib name of file.mtl at the begining and all the textures loaded upon reimport!
needs tweaking ie opacity maps etc but a start
Hi Wendy...
I was looking over your screen shots trying to find a problem and the only thing that catches my eye off hand is that there is no space after the MTL file name and the # comment
Try entering a return after mtllib frame_18.08.2012_17.44.16.mtl so that #AR=1.34039, FOV=55.98316(height), Xscale:0.71245, Yscale:0.53152,Zscale:1.0 is on a separate line
It's thinking the whole thing is the file name.
Congrats!!! :cheese:
glad you got it working.