Non-English Characters in a OBJ and MTL file
3dOutlaw
Posts: 2,479
So I am importing a OBJ that has a MTL and of course the materials.
The OBJ load fine, but the MTL material names are all in Japanese, and they do not line up with the MTL...as a result. This means all 100+ materials do not get assigned.
Anything I can do about this? I am exporting the OBJ from Blender.
Post edited by 3dOutlaw on
Comments
Need to rename them before export I would guess or maybe notepad
I had similar problems with assigning FBX bones in iClone from a Mikimikudance figure and giving each one a number was only solution but was told on the Reallusion forum it is more a computer language version issue, if set to Japanese would be fine.
Renaming...either before export or by find/replace in a text editor is the only way I can think of, if you don't want to try it on a Japanese version of Windows.
Do you have PHP (command line version) installed by chance? Then I can write you a quick script to translate the material names in the .mtl and .obj file. Saves the hassle on renaming them manually.
Unfortunately, no I don't have PHP loaded, but if you have the script, I have a buddy who can compile it to Windows exe for me, supposedly, that may work! :)
OK, so I was able to strip the characters out with Notepad++ :)
Since they are named like 12:, 13:, 14:...it should still work.
Now the problem is the diffuse map is not importing?
Do you see anything wrong with the format of the MTL that woudl cause DAZ not to asign the map_kd and map_d texture maps?
It is using absolute paths instead of relative so if the file/folder structure isn't exactly the same on your system they won't be found.
Hmm...that made me look twice, and I notice the absolute paths also have double-slashes...that may be throwing it off!
I'll try changing both
FWIW the texture paths in the .mtl file is the most common cause of textures (and sometimes even diffuse colours) failing to apply properly when you import an .obj mesh. There are way too many different ways modelling programs can create obj/mtl file pairs, and they don't always match all the different ways other programs expect to read them.
Some programs create the .mtl file with all texture paths absolute. Some place all the textures in a subfolder of wherever the .obj file is. The first non-comment line in the .obj states the name of the .mtl file; if anyone changes the file names without changing this, then the .mtl will never be read (this is usually why diffuse colours go berserk) and you won't get an error message.
I do a lot of importing .obj files, so I've got into the habit of always checking out what's in the actual files before I ever try hauling them into D|S. More often than not, I need to do a bit of minor (or not so minor) editing.
OK, it was the relative versus absolute path. When I changed to relative, and just moved the textures to the same Directory as the MTL/OBJ....then it worked. Thanks for the tip!