MPI-IS / mesh

MPI-IS Mesh Processing Library
Other
643 stars 147 forks source link

Adding Texture #69

Open hshreeshail opened 2 years ago

hshreeshail commented 2 years ago

I took the smplx_texture_m_alb.png texture image file (see image below) from the SMPLX Blender Add-On (available at https://smpl-x.is.tue.mpg.de/download.php). I wanted to add texture to the SMPLX mesh using this image outside of Blender. smplx_texture_m_alb_1024

Following the documentation of MPI Mesh, I used the following command: Mesh.set_texture_image('smplx_texture_m_alb.png'). However, I am facing an issue with the eye positioning in the output (see figure below): textured

What is causing this issue? Note that the texture is getting loaded correctly when imported in Blender add-on. (see figure below) image

masonwang513 commented 1 year ago

@Shreeshail-Hingane Have you solved this problem ? I encountered the same issue when texturing smplx template human

from psbody.mesh import Mesh, MeshViewer

save mesh with uv map

mesh = Mesh(v=vertices, f=data['f']) mesh.vt = data['vt'] mesh.ft = data['ft'] mesh.write_obj('./temp.obj')

reload and add texture

mesh = Mesh(filename='./temp.obj') texture_path = './smplx_blender_addon/data/smplx_texture_m_alb.png' mesh.set_texture_image(path_to_texture=texture_path) mv = MeshViewer() mv.set_static_meshes([mesh])

image

hshreeshail commented 1 year ago

I just used a different texture file that worked. Like this file: https://github.com/YadiraF/PIXIE/blob/master/data/smplx_tex.png

masonwang513 commented 1 year ago

I just used a different texture file that worked. Like this file: https://github.com/YadiraF/PIXIE/blob/master/data/smplx_tex.png

it works. thanks.