text2mesh
text2mesh copied to clipboard
How to obtain textures?
Hello, thank you for sharing this incredible project. I am testing text2mesh and do not see any textures as output beside some PT files. How shall I go in order to add textures to the final .obj? We are using Blender or any similar 3d software. Thank you so much for your help! Mattia
Hi Mattia. Our method does not generate a uv texture map, which would require parametrization (unnecessary for our method). Instead we simply predict a color at each vertex position. These colors are saved in the .obj files output by the code. These vertex colors will be sufficient for many tasks that would involve a texture map, but not possible for tasks that require a parametrization i.e. texture transfer.
If you want to view these colors in blender, you can bake them. You would probably need to use auto UV unwrap and convert the obj to ply. This tutorial might be helpful: https://youtu.be/7cphcAZ5ai8
Thank you ojmichel, I opened the obj in Meshlab and managed to export textures from there! What would be the best way to increase the resolution of the output model? I am remeshing the original source meshes and increasing the number of vertices but still getting some errors when running the model. Is there any specific setting in Meshlab we have to be aware when exporting? And is there somewhere a description of the various commands? Sigma, Geoloss, clamp tanh, normincrop, max crop, etc etc ?
@MattiaCasalegno-PRATT can you explain how you exported the textures from Meshlab? I've tried to convert the vertex color to UV texture, but it never works. I don't have much experience with meshlab, so i could be doing something wrong
@MattiaCasalegno-PRATT can you explain how you exported the textures from Meshlab? I've tried to convert the vertex color to UV texture, but it never works. I don't have much experience with meshlab, so i could be doing something wrong
if the question is still actual, here is the way how you can export obj with textures from Meshlab:
- Import mesh into Meshlab
- Filters/Texture/Parameterization: Trivial per-triangle
- Filters/Texture/Transfer: Vertex Attributes to Texture (1 or 2 meshes). Check Assign Texture and Fill Texture checkboxes
- Export Mesh
I found a way to do this programmatically with pymeshlab (pip install pymeshlab
)
import pymeshlab
ms = pymeshlab.MeshSet()
ms.load_new_mesh('person_final.obj')
ms.compute_texcoord_parametrization_triangle_trivial_per_wedge()
ms.transfer_attributes_to_texture_per_vertex(pullpush=True)
ms.save_current_mesh('person_final.obj', save_textures=True)
It saves the mesh into 3 files : .obj, .png and .mtl
Hi, is there an easy way to increase the resolution of the object file. Also, I noticed that the final .obj file also has a different size ratio.
I found a way to do this programmatically with pymeshlab (
pip install pymeshlab
)import pymeshlab ms = pymeshlab.MeshSet() ms.load_new_mesh('person_final.obj') ms.compute_texcoord_parametrization_triangle_trivial_per_wedge() ms.transfer_attributes_to_texture_per_vertex(pullpush=True) ms.save_current_mesh('person_final.obj', save_textures=True)
It saves the mesh into 3 files : .obj, .png and .mtl
If I understand correct, the python script that contains the code snipets should be put in the same folder with the produced .obj file, right?