OpenSubdiv/examples/python
manuelk 3ae50d1c50 Amending Apache license language & file headers.
New text:

     Copyright 2013 Pixar

     Licensed under the Apache License, Version 2.0 (the "Apache License")
     with the following modification; you may not use this file except in
     compliance with the Apache License and the following modification to it:
     Section 6. Trademarks. is deleted and replaced with:

     6. Trademarks. This License does not grant permission to use the trade
        names, trademarks, service marks, or product names of the Licensor
        and its affiliates, except as required to comply with Section 4(c) of
        the License and to reproduce the content of the NOTICE file.

     You may obtain a copy of the Apache License at

         http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the Apache License with the above modification is
     distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
     KIND, either express or implied. See the Apache License for the specific
     language governing permissions and limitations under the Apache License.
2013-09-26 12:04:57 -07:00
..
__init__.py Amending Apache license language & file headers. 2013-09-26 12:04:57 -07:00
canvas.py Amending Apache license language & file headers. 2013-09-26 12:04:57 -07:00
interactive.py Amending Apache license language & file headers. 2013-09-26 12:04:57 -07:00
main.py Amending Apache license language & file headers. 2013-09-26 12:04:57 -07:00
README.md typo in the Python readme 2013-02-11 16:24:27 -08:00
renderer.py Amending Apache license language & file headers. 2013-09-26 12:04:57 -07:00
shaders.py Amending Apache license language & file headers. 2013-09-26 12:04:57 -07:00
simple.glsl Amending Apache license language & file headers. 2013-09-26 12:04:57 -07:00
utility.py Amending Apache license language & file headers. 2013-09-26 12:04:57 -07:00
window.py Amending Apache license language & file headers. 2013-09-26 12:04:57 -07:00

This folder defines a small demo application that requires PyQt, PyOpenGL, and the Python bindings for OpenSubdiv (which in turn require numpy and SWIG).

Screenshot

  • main.py This is what you invoke from the command line. All calls to the osd module go here. Creates a QApplication and periodically pushes new VBO data into the renderer. (see below)
  • renderer.py Defines the renderer; implements draw and init. All OpenGL calls are made in this file, and there's no dependency on Qt or osd.
  • canvas.py Inherits from QGLWidget and calls out to the renderer object (see above)
  • shaders.py Implements a miniature FX format by extracting named strings from a file and pasting them together
  • simple.glsl Specifies the GLSL shaders for the demo using the miniature FX format
  • utility.py Some linear algebra stuff to make it easier to use Modern OpenGL
  • window.py Inherits from QMainWindow, instances a canvas object
  • interactive.py Invoke this from the command line to spawn an alternative demo that has an interactive prompt.
  • __init__.py Exports main into the package namespace to make it easy to run the demo from setup.py