OpenSubdiv/python/README.md
2013-02-06 19:24:40 -08:00

1.3 KiB

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.