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

How do I extract the colors of each vertex after loading the .obj file ? #130

Open
HaziqRazali opened this issue Feb 19, 2021 · 1 comment

Comments

@HaziqRazali
Copy link

How do I extract the colors of each vertex after loading the .obj file? I am only able to extract the coordinates of each vertex using the code below. How about the colors of each vertex?

    object = Wavefront(object_name+".obj", create_materials=True, collect_faces=True)

    # collect faces
    faces = []
    for mesh in object.mesh_list:
        faces = faces + mesh.faces
    
    # collect vertices
    vertices = object.vertices
@einarf
Copy link
Member

einarf commented Feb 19, 2021

Colors should be in object.vertices and also interlaved in each material. You will have to look at the vertex format in the last case.

See: #87 (comment)

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