I’m taking 3D scans of pieces, and needing to import them along with their materials into SketchUp. I have successfully imported the .obj file, but the materials are not coming with it. The .mtl file is in the same folder as the .obj file @thomthom can you help me figure out why the materials are not importing as well? Here is the piece I am using as a test.
mesh test.zip (2.4 MB)
Your OBJ file is poorly written.
What are you using to make it ?
The OBJ does NOT define the MTL file that to be used to define materials.
And anyway, no faces are assigned a material - irrespective of its existence in the MTL !
The MTL file also assumes the image files are to be found in its own folder - the normal convention is:
Textures/tex_0.jpg
So it is somewhat unconventional.
So to recap…
Currently your OBJ has no contact with its MTL.
The MTL is also setup to use image files in its own folder - rather than the the more usual subfolder of texture images…
I am using 123D catch to take the 3D scan, but then having to open it in meshmixer to reduce the polygons re-saving afterward so that I’m able to import it into SketchUp without it taking an hour minimum just to import the file.
But as I explained yesterday…
The OBJ file has no reference in it to its MTL file, so no materials are made.
Also no materials are specified for faces anyway.
You could try adding:
mtllib mesh.mtl
at the start of the OBJ file so at least the materials defined in the MTL file get made.
BUT then the issue is how to assign them to the faces.
Since there’s only one group defined you need to know how to allocate materials to faces - since you have messed with the mesh I think it’ll be impossible to do that…
Have you considered importing the more complex OBJ with materials into say Blender ?
Then simplifying it and exporting as OBJ again…
So is it Meshmixer which produce this OBJ without MTL reference? No export options?
Please forgive me, I’m very new to this, have no coding experience to speak of, and I’m really just feeling around in the dark.
I can’t attach the zip folder that I dowloaded straight out of 123D Catch, it’s too large. But here it is on the website, and the files can be downloaded from there. Versa Connector (TNDCI DEV) 0.0.1 - Sign On if you want to take a look at the raw file.
In that previous one from yesterday, I had opened the .obj file in meshmixer then reduced the polygons by something like 95% because I really don’t need the level of detail it has originally (plus my computer just can’t handle that size file and it takes several hours to open in sketchup then often crashes). So after reducing it I export it as a .obj replacing the much higher polygon count file. I suppose that screwed it up enough that it doesn’t recognize the necessary MTL references. No materials show up in meshmixer when I open it in there either though.
I’m downloading blender right now like @TIG suggested maybe it’ll work better. I’m just too used to sketchup, and have little to no experience with any other program. Like I said, feeling around in the dark!
We can’t download the linked file unless we are members.
Can you link it to a public sharing site - lie DropBox ?
When you ‘downgrade’ the mesh are there no options to keep materials etc ?
HAHAHA! I did it!! For some reason when exporting the new reduced polygon mesh from meshmixer, it was adding some quotation marks to the mtl reference in the obj file code. I got rid of them and it properly referenced the mtl files when importing it into sketchup and it’s beautiful!
Thanks guys, I appreciate your insight
A miracle
Lol. Hey, for me, it was!
I’m have the same problem. I need human figures for an architectural project in specific poses. I purchased some fully rigged figures from an online source in blender format. I pose the figures in Blender, then export as an .obj file. This generates both an .obj file and a .mtl file. The .obj comes into Sketchup okay (with a few holes) but the materials don’t. How can I fix this?
The MTL and OBJ are usually in the same folder.
Open the OBJ file in a text processor and see where it looks for the MTL file…
Open the MTL file in a text processor and see where it looks for the various materials files…
Usually it’s set to be a subfolder containing image files in the same folder as the OBJ and MTL files.
Ensure that both of these files and the subfolder of images are in the correct relationship…
Thanks for your quick response. The OBJ and MTL files are in the same folder named fig 114 on my desktop. When I open the files in a text editor I get this:
However I think I am doomed anyway because another OBJ file I was able to successfully import to SketchUp crashes SketchUp when I try to use the rendering app (Podium xRT). Thanks anyway.
After importing the .obj file have you looked at the In Model materials? Do the materials show there? I’ve seen imports where the model looks like it’s just wireframe but it turns out the materials are all displayed with zero opacity.
Is the MTL folder path mentioned inside the OBJ file’s header ?
Is there a path to a material image-files’ subfolder, mentioned in the MTL folder header ?
Does this subfolder exist ?
You answer thus far is incomplete.
Hi, Dave:
Yes, the materials show up in the model materials.
Did you check them to see what their opacity is set to? It would be helpful if you shared the .skp file.
Here’s a link to the file. I’m not a Blender expert by any means. Two of these figures are posed, two of them unposed in Blender. All of these .objs were exported from Blender and imported into Sketchup. The ones that the materials show up on were brought in before I upgraded my System software to Mac OS Sonoma 14.7.1. Since then, whether posed or unposed, the materials don’t come in with the figure. Box