Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to obtain textures? #14

Open
MattiaCasalegno-PRATT opened this issue Mar 27, 2022 · 8 comments
Open

How to obtain textures? #14

MattiaCasalegno-PRATT opened this issue Mar 27, 2022 · 8 comments

Comments

@MattiaCasalegno-PRATT
Copy link

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

@MattiaCasalegno-PRATT MattiaCasalegno-PRATT changed the title How obtain textures? How to obtain textures? Mar 27, 2022
@ojmichel
Copy link

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.

@ojmichel
Copy link

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

@MattiaCasalegno-PRATT
Copy link
Author

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 ?

@chrober24
Copy link

@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

@artem-konevskikh
Copy link

artem-konevskikh commented Aug 28, 2022

@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:

  1. Import mesh into Meshlab
  2. Filters/Texture/Parameterization: Trivial per-triangle
  3. Filters/Texture/Transfer: Vertex Attributes to Texture (1 or 2 meshes). Check Assign Texture and Fill Texture checkboxes
  4. Export Mesh

@Achuttarsing
Copy link

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

@Debangsha1992
Copy link

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.

@EadmondDai
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants