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

Failed to assign point cloud vertex color to a mesh #1563

Open
dongchen-yang opened this issue Jan 5, 2025 · 0 comments
Open

Failed to assign point cloud vertex color to a mesh #1563

dongchen-yang opened this issue Jan 5, 2025 · 0 comments

Comments

@dongchen-yang
Copy link

dongchen-yang commented Jan 5, 2025

Hi,

I have a mesh and a point cloud sampled from the mesh. I then assigned some color to the point cloud. I want to transfer the color to the mesh and generate a texture map, but it seems to fail to do so and the generated texture map is completely blank. Here is the code to reproduce it I have also attached the link for .ply and .obj files.

Thank you so much for your time!

import pymeshlab
import os
ply = "59.ply"
obj = "59.obj"
ms = pymeshlab.MeshSet()
ms.load_new_mesh(ply)
ms.load_new_mesh(obj)
ms.compute_texcoord_parametrization_triangle_trivial_per_wedge()

mesh_name = os.path.basename(ply).replace(".ply", "")
ms.transfer_attributes_to_texture_per_vertex(sourcemesh=0, targetmesh=1,attributeenum=0,textname=f"texture_{mesh_name}.png")
ms.save_current_mesh( f"{mesh_name}_new.obj")
# print(ms)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants