|06 June 2013||#17|
Nocturnal Sun Gazer
Join Date: Apr 2003
I don't mean to hi-jack the thread - just to help - but having said that, I did want to mention that my Riptide Pro plugin [among hundreds of other useful things...] does of course read .mtl files (you can even select them directly, and read them instead of a .obj + .mtl, if you want).
With that out of the way, your script is useful for people who don't use my plugin, so...
Originally Posted by c4d-jack: I also noticed, that materials from many MTL come out transparent even though it makes no sense. The problem is: That is correct. The MTL file contains a transparency value of 1.0, which (according to the Wikipedia article) means 100% transparent.
I can imagine that some applications mean to interpret that as 100% opaque, but since there is no way to recognize that from the MTL file, I can't help it.
This is actually incorrect. The 'd' ("Dissolve" / transparency) record: 0 = completely transparent, 1 = completely opaque. As far as I know, there is no "Tr" keyword in the file format. I may not have seen the Wikipedia article you mention, but it sounds incorrect. This link is about the closest thing you'll find for the actual/original spec, although this link might be a little easier to follow.
Originally Posted by c4d-jack: You mean the textures, right? Well, the path is taken directly from the MTL file, and should be relative to the MTL file. Open the file with a text editor and take a look (the relevant lines start with "map_").
If a program exports MTL files with wrong paths, then I can't help it.
Technically, there should be NO path information in a .obj or .mtl file... (at least that is my contention). Note that the file format is so old that it didn't ever even address things like "spaces" in file names - spacing (white space) is instead used to separate record statements and qualifiers. Riptide Pro strips out any path information and let's Cinema 4D find texture files based on properly set up Cinema 4D "Texture Paths" preferences and/or it's own local searching (local tex folder, etc). I'd recommend doing the same.
Originally Posted by c4d-jack: MTL is just a very old, rather crappy and definitely outdated format. The script should simply help with getting the basic colors and textures assigned. Don't expect any high-end ready-to-render materials to come out of it.
Good point... just to add to that, you'll find that there are various levels of "horrible" implementations of importing/exporting .mtl files. Daz Studio (D|S) is notorious for "not following the spec", for example. Everything from including (it's own idea of) path information to inventing it's own keywords (and capitalization) for records.
To make a robust reader, Riptide Pro has the following "work-arounds":
Anyway, I haven't seen/looked at your script yet, but I'll be interested in trying it out.
Last edited by Keith Young : 06 June 2013 at 04:24 AM.
|06 June 2013||#18|
Join Date: Sep 2003
Thread automatically closed
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
|Thread Closed share thread|