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

export mesh with texture map #29

Open
DHPark98 opened this issue Jul 2, 2024 · 0 comments
Open

export mesh with texture map #29

DHPark98 opened this issue Jul 2, 2024 · 0 comments

Comments

@DHPark98
Copy link

DHPark98 commented Jul 2, 2024

Hi, thanks for your great works and code.
I added some lines to 'animation.py' file to export mesh (.obj file) of final 3dgs output like below.
However, it doesn't export texture map (.mtl file).
Can I export texture map with this code, or is there any other way to export mesh with texture map?

added code:

 path = "Results/name-of-this-experiment-run/A_boy_with_a_beanie_wearing_a_hoodie_and_joggers@20240625-124529"
obj_filename = 'example.obj'

mesh = gui.skel.gs.gaussians.extract_mesh(path)
vertices = mesh.v
faces = mesh.f

with open(obj_filename, 'w') as obj_file:
    if mtl_filename:
        obj_file.write(f"mtllib {mtl_filename}\n")

    for v in vertices:
        obj_file.write(f"v {v[0]} {v[1]} {v[2]}\n")

    for f in faces:
        obj_file.write(f"f {f[0] + 1} {f[1] + 1} {f[2] + 1}\n")
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

1 participant