1PyAssimp Readme
2===============
3
4A simple Python wrapper for Assimp using `ctypes` to access the library.
5Requires Python >= 2.6.
6
7Python 3 support is mostly here, but not well tested.
8
9Note that pyassimp is not complete. Many ASSIMP features are missing.
10
11USAGE
12-----
13
14To get started with pyAssimp, examine the `sample.py` script in `scripts/`,
15which illustrates the basic usage. All Assimp data structures are wrapped using
16ctypes. All the data+length fields in Assimp's data structures (such as
17`aiMesh::mNumVertices`, `aiMesh::mVertices`) are replaced by simple python
18lists, so you can call len() on them to get their respective size and access
19members using [].
20
21For example, to load a file named 'hello.3ds' and print the first
22vertex of the first mesh, you would do (proper error handling
23substituted by assertions ...):
24
25```python
26
27from pyassimp import *
28scene = load('hello.3ds')
29
30assert len(scene.meshes)
31mesh = scene.meshes[0]
32
33assert len(mesh.vertices)
34print(mesh.vertices[0])
35
36# don't forget this one, or you will leak!
37release(scene)
38
39```
40
41Another example to list the 'top nodes' in a
42scene:
43
44```python
45
46from pyassimp import *
47scene = load('hello.3ds')
48
49for c in scene.rootnode.children:
50    print(str(c))
51
52release(scene)
53
54```
55
56INSTALL
57-------
58
59Install `pyassimp` by running:
60
61> python setup.py install
62
63PyAssimp requires a assimp dynamic library (`DLL` on windows,
64`.so` on linux :-) in order to work. The default search directories
65are:
66
67- the current directory
68- on linux additionally: `/usr/lib` and `/usr/local/lib`
69
70To build that library, refer to the Assimp master INSTALL
71instructions. To look in more places, edit `./pyassimp/helper.py`.
72There's an `additional_dirs` list waiting for your entries.
73
74