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

ValueError: Cannot use face colors with a smooth mesh #17

Open
ChrisGoettfert opened this issue Feb 22, 2023 · 1 comment
Open

ValueError: Cannot use face colors with a smooth mesh #17

ChrisGoettfert opened this issue Feb 22, 2023 · 1 comment

Comments

@ChrisGoettfert
Copy link

Hi,

Thanks for your great work. I wanted to export animation videos and set the boolean save_animation (line 19) in main_test_avatarposer.py to True. This creates: ValueError: Cannot use face colors with a smooth mesh

Full output:

/home/christopher/Downloads/AvatarPoser/venv/bin/python /home/christopher/Downloads/AvatarPoser/main_test_avatarposer.py
export CUDA_VISIBLE_DEVICES=0
number of GPUs is: 1
LogHandlers setup!
-------------------------------number of test data is 536
Dataset [AMASS_Dataset - test_dataset] is created.
Initialization method [kaiming_normal + uniform], gain is [0.20]
Training model [ModelAvatarPoser] is created.
Loading model for G [model_zoo/avatarposer.pth] ...
23-02-22 16:12:21.641 : testing the sample 0/536
Traceback (most recent call last):
File "/home/christopher/Downloads/AvatarPoser/main_test_avatarposer.py", line 178, in
main()
File "/home/christopher/Downloads/AvatarPoser/main_test_avatarposer.py", line 140, in main
vis.save_animation(body_pose=gt_body, savepath=save_video_path_gt, bm = model.bm, fps=60, resolution = resolution)
File "/home/christopher/Downloads/AvatarPoser/utils/utils_visualize.py", line 196, in save_animation
mv.set_static_meshes([checker_mesh,body_mesh])
File "/home/christopher/Downloads/AvatarPoser/venv/lib/python3.10/site-packages/body_visualizer/mesh/mesh_viewer.py", line 97, in set_static_meshes
def set_static_meshes(self, meshes, poses=[]): self.set_meshes(meshes, group_name='static', poses=poses)
File "/home/christopher/Downloads/AvatarPoser/venv/lib/python3.10/site-packages/body_visualizer/mesh/mesh_viewer.py", line 88, in set_meshes
mesh = pyrender.Mesh.from_trimesh(mesh)
File "/home/christopher/Downloads/AvatarPoser/venv/lib/python3.10/site-packages/pyrender/mesh.py", line 209, in from_trimesh
color_0, texcoord_0, primitive_material = Mesh._get_trimesh_props(m, smooth=smooth, material=material)
File "/home/christopher/Downloads/AvatarPoser/venv/lib/python3.10/site-packages/pyrender/mesh.py", line 272, in _get_trimesh_props
raise ValueError('Cannot use face colors with a smooth mesh')
ValueError: Cannot use face colors with a smooth mesh

Process finished with exit code 1

@yc4ny
Copy link

yc4ny commented Mar 7, 2023

@ChrisGoettfert I faced this problem as well.

In body_visualizer/mesh/mesh_viewer.py :

Fix line 88: mesh = pyrender.Mesh.from_trimesh(mesh)
to
mesh = pyrender.Mesh.from_trimesh(mesh, smooth = False)

and it seems to work.

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

2 participants