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

Can you access vertices and UV of a face in PyWavefront? #146

Open
nickponline opened this issue Feb 26, 2023 · 1 comment
Open

Can you access vertices and UV of a face in PyWavefront? #146

nickponline opened this issue Feb 26, 2023 · 1 comment

Comments

@nickponline
Copy link

nickponline commented Feb 26, 2023

@einarf How do you find the vertices and UV associated with a face. I can access the faces (scene.mesh_list[0].faces) and the vertices and UV of each material:

for name, material in scene.materials.items():
    print(name)
    print("   ", material.vertex_format) # T2F_V3F
    print("   ", len(material.vertices))

But no matter what I try I cannot take a face (v1, v2, v3) and find the vertices and UV associated with it? Am I missing something obvious?

@fjansson
Copy link

I think I have the same question. In a .obj file with several materials, how do I know which faces belong to which material? I'd like to have a material-specific list scene.materials['materialname'].faces to match scene.materials['materialname'].vertices.

There is some discussion in #87, #88.

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