Commit Graph

26 Commits (adc3de3882824f82825933e7d36f372a1672d317)

Author SHA1 Message Date
Séverin Lemaignan ab268b9f48 [pyassimp] Added a NullHandler to the logger
While here, many cleaning in log messages + promote some warning to errors
2012-10-23 14:55:53 +02:00
Séverin Lemaignan 18825179d0 [pyassimp] Support Python3
This include the renaming of __init__.py in core.py to solve tricky imports issues

sample.py runs correctly, except that the ctype structure returned is not
complete. The issue is very similar to the one we have with 32bits/64bits
issues

Removed the PyAssimp3 subproject project.

To maintain source compatibility between py2 and py3, python >= 2.6 is now required
2012-10-23 14:55:53 +02:00
Séverin Lemaignan 79ed83244c [pyassimp] Added an simple OpenGL viewer for pyassimp
Based on pyOpenGL.

Uses VBO/IBO for reasonable performances.

Support only basic materials (no textures)
2012-10-23 14:55:53 +02:00
Séverin Lemaignan 36c424bfb2 [pyassimp] Import post-processing constants in pyassimp 2012-10-23 14:55:53 +02:00
Séverin Lemaignan 4e9214c624 [pyassimp] Apply post-processing on ctypes ASSIMP structure
- bind meshes to their materials
- add transformations to cameras
2012-10-23 14:55:53 +02:00
Séverin Lemaignan 511f80d047 [pyassimp] Use numpy when possible
It allows for faster access to data, brings useful methods and is
pyOpenGL-friendly

It eases manipulation of matrices and vectors (many operations like
product, transposition, etc. are available)

numpy.array are also directly usable in many places in pyopengl.

And make sure we store floats as float32 to please OpenGL

Update sample.py to be happy with numpy arrays
2012-10-23 14:55:52 +02:00
Séverin Lemaignan 7000ea05c5 [pyassimp] Large rewrite: more generic, easier to use
Main changes:
- dynamic creation of idiomatic python fields corresponding to ASSIMP ones,
- hidding of pointers,
- use of numpy for transformation and mesh data storage

For instance, to access the list of meshes of a children of the root
node, previously we did:

scene.mRootNode.contents.mChildren[1].contents.mMeshes

Now, it is:
scene.rootnode.children[1].meshes

Arrays are now regular Python list.

Also added a 'post-processing' to access directly to certain objects,
and not through their index. For instance:

Before:

mymesh_id = scene.mRootNode.contents.mChildren[1].contents.mMeshes[2]
mymesh = scene.mMeshes[mymesh_id]

Now:
scene.rootnode.children[1].meshes[2]

Initialization of the Python wrappers is not delayed anymore: everything
is done during the loading (which leads to long start time, but prevent
unexpected slowing at runtime)

This commit also remove several 'ad-hoc' manipulation that should not
be needed anymore.

While here, use Python logging when necessary.
2012-10-23 14:53:00 +02:00
Séverin Lemaignan bed0e4e83f [pyassimp] Add /usr/lib to the path where to look for libassimp 2012-10-23 14:52:47 +02:00
Séverin Lemaignan 848c875ec2 [pyassimp] Update, fix and beautify structs.py
structgen.py has been modified to make the resulting structs.py
more readable: comments should now correctly appear next to the
fields in the generated structs.py

Do not discard the size_t type. size_t was wrongly replaced by uint in ctypes
This caused corruptions when running pyassimp with a 64bits assimp library

While here, updated the max size of some meshes attributes (that leads
to corruptions as well)

While here, update paths to find the assimp headers

Updated structs.py to match assimp 2.0.863 (Ubuntu 12.04). It has been
also tested with libassimp as build from the trunk.
2012-10-23 14:41:52 +02:00
aramis_acg 6dc3bc1c88 # PyAssimp: fix data type for aiString::length. Thanks to Gellule for the patch.
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@1091 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2011-11-29 13:34:48 +00:00
aramis_acg 9350d0e1a6 - update pyassimp genstructs script to work with the latest headers, add rudimentary test script to batch-load all test files using pyassimp
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@951 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2011-04-19 20:48:33 +00:00
aramis_acg 9d2eacfdb2 Fix call to assimp.aiReleaseImport(), scene pointer was passed in incorrectly
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@565 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2010-03-02 14:49:35 +00:00
aramis_acg cc489f30e7 Change pyAssimps library detection routine to work on Linux as well
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@564 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2010-03-02 13:48:17 +00:00
aramis_acg 722dc4a9c2 Fix PyAssimp complaining on 'builtin_function_or_method' object has no attribute '_init'. Thanks to pekuja for the patch!
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@552 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2010-02-25 20:11:57 +00:00
sueastside b2ffa9dd1b Added ASSIMP_API to aiCreateQuaternionFromMatrix and aiDecomposeMatrix.
Added aiDecomposeMatrix to PyAssimp.

git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@410 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2009-04-27 15:43:01 +00:00
sueastside 55a3d845c9 Changed structs.py to export the original names of the C structs, not uppercase.
Totally rewrote pyassimp, removing all pyassimp classes, instead using python's dynamic nature to expand the ctypes structures to include safe array access and python style tuple access.
Updated helper.py and sample.py.

git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@406 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2009-04-25 21:12:53 +00:00
aramis_acg 760bcbbf69 Updating PyAssimp to the latest data structures. Many thanks to sueastside for the patch.
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@402 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2009-04-23 20:58:16 +00:00
sebastianhempel a4f2aab6c3 textures
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@162 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2008-09-23 13:11:30 +00:00
sebastianhempel 64c431b5eb materials
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@161 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2008-09-23 12:38:39 +00:00
sebastianhempel 0d5bb1c427 intelligent library search
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@155 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2008-09-19 18:06:04 +00:00
sebastianhempel 02f1c9c9b9 bones
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@153 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2008-09-19 17:52:58 +00:00
sebastianhempel 398879779e searches assimp-library automatically
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@151 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2008-09-18 13:36:34 +00:00
sebastianhempel b50b8b3f43 new helper module; faces
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@150 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2008-09-18 13:17:44 +00:00
sebastianhempel d7bc843ae6 texture coordinates
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@149 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2008-09-18 12:45:03 +00:00
sebastianhempel 4b013dbeba basic setup for test-models and some docstrings.
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@148 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2008-09-17 17:08:36 +00:00
sebastianhempel 4f5a880306 PyAssimp initial import.
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@147 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2008-09-17 15:25:20 +00:00