Search code examples
meshlabmeshroom

How to correctly export a mesh as a .obj using "export mesh as" ?- unable to get a file with the textures


I probably gave too much detail here - but I am really stuck and can't find documentation to a seemingly simple process: I use Meshroom to create a 3D model and it saves it as 3 files: texturedMesh.obj, texturedMesh.mtl and a texture_1001.png. I then use Meshlab to clean-up the model, by first importing it using the "import mesh" from the File dropdown menu. I point Meshlab to the folder containing my Meshroom files (above) and MeshLab opens it and it looks like it is supposed to with textures. After I do my cleaning, I then want to upload it to Sketchfab, so first I choose the "export mesh as" option from Meshlab. A pop-up appears called "Save 'texturedMesh.obj' Layer", I then choose Alias Wavefront Object (.obj) as the file format, I change the File Name to: texturedMesh2.obj and click save. Another pop-up comes up called "Choose Saving Options for: 'texturedMesh' - not texturedMesh2 (don't know if this is a problem or not) and then it wants to save a texture file and call it texture_1001.png - the normal, color and TexCoord boxes are all checked as defaults and the radio button "All" is also pressed. I then press the OK button and the green status bar shows that it is saving something. When I look in the folder I have two files: texturedMesh2.obj and texturedMesh2.obj.mtl and no .png file. I then use 7-zip to zip these two files and upload to Sketchfab, once uploaded the model is white with no texture file. I've read differing accounts whether the texture file could be embedded in the .mtl file - but it looks like it is not. How do I export a mesh as a .obj and have Meshlab output all of the files I need?


Solution

  • When you change the filename in meshlab, it will still use the same .png file name as texture. You need to manually copy it to the same directory where .obj file is.

    I would change your work pipeline to

    1. Create mesh with meshroom.
    2. Create backup as zip file (obj+mtl+png)
    3. Clean mesh with meshlab and save using same filename.
    4. Create final model as zip file (obj+mtl+png) to upload to sketchfab.