Pyffle - a FreeFrame 1.5 (FFGL) plugin letting you write new plugins in Python. ------------------------------------------------------------------------------ Caveats: It only runs on Windows, and requires that Python 2.6 already be installed in c:\Python26. It has only been tested with Resolume 4.0.1. ------------------------------------------------------------------------------ Prerequisites: You must have Python 2.6 already installed, along with the OpenGL package. You can download Python 2.6 from http://python.org. The simplest method to install the OpenGL bindings is to install the setuptools package from http://pypi.python.org/pypi/setuptools (make sure you install the win32-py2.6 version), and then execute the following command: c:\python26\scripts\easy_install.exe PyOpenGL ------------------------------------------------------------------------------ Installation: The C source code for Pyffle is here, but you don't need to recompile it. Just copy everything in the Binaries/win32 directory over to your FFGL directory, or add Binaries/win32 to your list of FFGL directories. If things are working, Pyffle-based plugins should show up in your FFGL host as plugins named Pyffle_*. ------------------------------------------------------------------------------ Creating a new plugin: See Binaries/win32/Pyffle/python/processor for some example plugins, one.py and two.py. If you want to create a new plugin named Pyffle_Three, you would: 1) create three.py in the processor directory. The class defined in three.py should be ThreeProcessor. Note the capitalizations. The python filename should be a lower-case version of the name, and the class name should be upper-case, with Processor appended to it. The class should be derived from Processor. Just use one.py as a template. 2) copy Binaries\win32\Pyffle_Default.dll to Binaries\win32\Pyffle_Three.dll That should be it. When adding a new plugin, you'll need to restart your FFGL host, unless it's capable of re-scanning the plugins. ------------------------------------------------------------------------------ Modifying a Pyffle-based plugin while your FFGL host is running: You should be able to remove a running Pyffle-based plugin, make modifications to its *.py file, and re-insert the plugin and run it immediately, without restarting your FFGL host. If you make modifications to files other than the one *.py that defines the plugin class, you'll probably have to restart the FFGL host, though you should be able to add code to the constructor of the plugin to reload other things that have changed. ------------------------------------------------------------------------------ Debugging: Debug messages are put in Pyffle\debug.txt, where Pyffle is either in Binaries\win32 or whatever directory you've copied it to. In your python code, you can print debug messages using pyffle.debug(), as illustrated in the processor\one.py example. There are some parameters you can adjust in Pyffle\config\default.txt to control the debugging behaviour. ------------------------------------------------------------------------------ Compiling: Included here is source code and project files that allow you to recompile the plugin with Visual Studio 2008. The project file assumes Python is in c:\Python26. As a post-build step, it invokes python on postbuild.py to update all of the separate copies (one for each Pyffle-based plugin) of the Pyffle_default.dll file. ------------------------------------------------------------------------------ Misc: The Pyffle\python directory contains a nosuch module with OSC utilities. The processor\osc.py plugin example shows how to create an osc listener in your plugin. See the comments in that file for any current issues with it. The OSC utilities in Pyffle\python\nosuch include some general-purpose things that can be useful. Invoke "python oscutil.py" in that directory to see usage. ------------------------------------------------------------------------------ Questions: Send email to Tim Thompson, me@timthompson.com ------------------------------------------------------------------------------