@tig said:
@whoa said:
Hello
I just installed your importer and I have no issue importing the .obj file, however I am not getting any textures?
Everything is just gray. I received the files from a furniture company, 4 seperate folders with several .obj files + .mtl and some jpgs that I guess are the textures. How do I add these into sketchup onto the objects?Thank you
You can read OBJ and MTL files in Notepad or equivalent.
The OBJ file defines the MTL file by name mtllib xxx.mtl.
The OBJ file usually expects the MTL file to be in the same folder as itself.
The MTL file defines materials.
They can be simple plain color like this (Kd values as %s =~[170,170,170]=~'mid-gray')
newmtl Color_003
Ka 0.000000 0.000000 0.000000
Kd 0.666667 0.666667 0.666667
Ks 0.000000 0.000000 0.000000
d 1.000000
or with a texture specified by an image-file it is like this
newmtl Wood_Floor
Ka 0.000000 0.000000 0.000000
Kd 0.607843 0.411765 0.239216
Ks 0.000000 0.000000 0.000000
d 1.000000
map_Kd MyModel/Wood_Floor.jpg
In this example the MTL file is expecting to find that material's texture's image-file called Wood_Floor.jpg in a subfolder that's in the MTL file's folder, that's named MyModel.
Note that many OBJ exporters use an image subfolder, but some do not - in that case the line might read
map_Kd Wood_Floor.jpg
and then the textures' image files should be in the same folder as the MTL file itself...
If an OBJ importer can't find the image file it usually skips using it, and just uses the color specified for the material - in the case of 'Wood_Floor' this would be an RGB color based on the Kd values, as percentages of 255 =~[155,105,61]=~'mid-brown'...Note that the 'd' value is the opacity: where 1.000000 is solid and 0.500000 is 50% transparent etc... So you can adjust these prior to import if desired...
Thank you so much TIG you just saved me from hours of trying to fix up the textures as normally happens when i try a new importer/exporter Thanks a bunch
BTW for anyone who also has this problem, my .OBJ said mtllib C:\......\*wheremyModelIs*\test.mtl
I changed it to mtllib test.mtl
- took off the directory data and it worked like a charm