OpenSubdiv/python
2013-02-06 22:05:56 -08:00
..
demo update docs 2013-02-06 21:27:16 -08:00
doc update doc to match enum names 2013-02-06 22:05:56 -08:00
osd update docs 2013-02-06 21:27:16 -08:00
test Revamped Python bindings that use SWIG 2013-02-04 21:10:58 -08:00
LICENSE Revamped Python bindings that use SWIG 2013-02-04 21:10:58 -08:00
README.md CMake now invokes distutils correctly 2013-02-06 19:24:40 -08:00
setup.py CMake now invokes distutils correctly 2013-02-06 19:24:40 -08:00

Instructions

The OpenSubdiv Python wrapper has been tested with Python 2.6 and Python 2.7. Make sure you install SWIG and numpy before you begin.

CMake builds the extension like this:

./setup.py build --osddir='../build/lib' --build-platlib='../build/python'

If you invoke this manually, you'll need to replace ../build/lib with the folder that has libosdCPU.a.

Next, try out the unit tests:

./setup.py test

You can clean, build, and test in one go like this:

./setup.py clean --all build test

If you'd like, you can try out an OpenGL demo. For this, you need to have PyQt and PyOpenGL installed.

./setup.py install --user demo

You can also install the module globally with:

sudo ./setup.py install

After installing the module, you can generate and view the Sphinx-generated documentation like so:

./setup.py doc
open ./doc/_build/html/index.html

To Do Items

  • Add support for face varying data by augmenting _FaceAdapter in adapters.py
    • Exercise this in the demo by getting it down to GPU (maybe do "discard" for certain faces)
  • Instead of using OsdCpuVertexBuffer, create a "NumpyCpuVertexBuffer" that wraps a numpy array
  • Add an API that looks very similar to the RIB parameters for RiHierarchicalSubdiv
  • Remove all the caveats that are listed in the Sphinx docs :)
  • Sphinx documentation should be CMake-ified.