Kraken_Games
Kraken_Games

Reputation: 11

How can I export a list of faces with vertices from blender?

How do I get a python list of coordinates for each face of a 3d blender model? I have read about bpy, but it is unclear whether I should use this in Blender's built in python terminal, or make a separate script that opens and reads blender files. I am trying to produce a list like this:

[
#each entry is a list of vertices for that given face
[(0, 0, 0), (2, 2, 0), (2, 2, 2)],
[(0, 0, 0), (2, 4, 0), (3, 4, 2)],
]

I am using this to render models in my own custom 3d-renderer, so ideally i could have a script that takes a blender model and turns it into a json file that lists all the faces and their vertices. How can I implement this?

Upvotes: 1

Views: 121

Answers (0)

Related Questions