mesh icon indicating copy to clipboard operation
mesh copied to clipboard

Adding Texture

Open hshreeshail opened this issue 2 years ago • 3 comments

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

hshreeshail avatar Jun 24 '22 17:06 hshreeshail

@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

masonwang513 avatar Sep 06 '22 07:09 masonwang513

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

hshreeshail avatar Sep 06 '22 10:09 hshreeshail

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.

masonwang513 avatar Sep 06 '22 12:09 masonwang513