Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reading data from 3d models with python

Tags:

python

parsing

3d

I want to extract the vertices and faces (as lists of vertices) from a 3d model. The format of the 3d model doesn't matter as long as it's generatable in Maya.

I would like to do this in Python. Are there any libraries, file types, etc. that you would recommend?

like image 355
pkinsky Avatar asked Feb 25 '11 01:02

pkinsky


1 Answers

I'm pretty sure Maya exports in OBJ file format, which is very heavily documented and implemented. Python's cgkit implements an OBJ parser, which you can find here: http://cgkit.sourceforge.net/doc2/objmtl.html

Edit: Actually, cgkit can read a lot more formats from Maya than just OBJ. I searched for OBJ since I knew it was ubiquitous.

like image 104
yan Avatar answered Oct 20 '22 07:10

yan