Yet Another Interpolator

Yet Another Interpolator is Inkscape with a spreadsheet slapped on, and with a python interpreter for good measure.

What is this, really?

Yet Another Interpolator is a modification of Inkscape with a two-dimensional array to allow easier selection and copying of objects. This is useful if you have many SVG objects (groups, paths, etc) that are really the same object but indexed by time.

Yet Another Interpolator also includes an interpolator that allows generating an object (indexed by time) at intermediate values of time. It can automatically answer these queries:

x(0) = (0,0), x(1) = (50,100), x(0.5) = ???

The answer is not always (25,50). This depends on the interpolant chosen. The answer may not even be of the form (t,2t). (Right now, piecewise linear and Catmull-Rom cubic spline are implemented for interpolation in space (x versus y), polynomial and simple harmonic motion ("elastic") are implemented for interpolation in time (x versus t). But you can define whatever function you want.)

Yet Another Interpolator includes an ipython interpreter so that you can programmatically (and instantly)

More features coming soon, possibly.

Basic usage

With YAI as editor and renderer

  1. Create a path (using the pen or pencil tool).
  2. Change this path's id to mypath-0. To quickly do this, change the entry of text box below the frame table next to Set to mypath-0 and then click Set.
  3. Click Track. A new row labelled mypath is created.
  4. Click on the only filled cell (row mypath, column 0). The cell turns cyan.
  5. Click Mark. The cell should turn purple.
  6. Click on the cell next to it (row mypath, column 1).
  7. Click Paste. This creates a new path named mypath-1.
  8. Edit this newly created path (move it around, change its points and handles, change fill and stroke hues and opacity).
  9. Click Interpolate.
  10. Drag the slider next to the Interpolate button. You should see a path move (progressively transform) from the first path you created the second path you created.
  11. Type wrap.animator.anim(0.5) in the ipython interpreter. This has the same effect as moving the slider to the midpoint.
  12. Type wrap.animator.run(1.0) in the ipython interpreter. This will move the slider from 0 to 1 at 0.1 second increments.

With YAI as a renderer only

  1. Create 2 paths with the same number of nodes however you want.
  2. Change the id of one path to mypath-0 and the id of the other path to mypath-1.
  3. Select one of the paths and click Track.
  4. Click Interpolate.

You could also just follow steps 1 and 2 and then use an external script (not yet available iwth YAI) on an SVG created with any version of Inkscape or any other program.

Why make this?

Many programs with UIs mix data specification (drawing the frames in this case) and data interpretation (rendering in this case). But I want mix and match. I discovered Inkscape by accident and really like its interface. But I also want to use that interface enter data that wasn't just vector graphics (animation for the moment).

Sometimes a programming language is the best thing for generating data. Sometimes being able to visually place points is much easier and faster.

So YAI was made. Right now, YAI is designed to work with Inkscape since its my preferred program for entering data of this kind. But ultimately, if you can separate the data entry from the data interpretation portion of a different program, YAI could be added to it too.

Eventually I'd like to enter any kind of data: audio, video, webpages using Inkscape's interface (and then parsing the output SVG). With the help of some default functions, each time I want to create the editor I need to create the document I want to making this a tedious task.

If the user knows what document they want to create and can describe it succinctly and precisely, it should be easy to make the document, even if its unorthodox.

Compiling

Pre-requisite

Since this is an Inkscape fork, everything for compiling Inkscape itself is needed. See Compiling Inkscape on the Inkscape Wiki.

Extra requirements

Linux

Tested on Ubuntu. Please e-mail me with any hints for other distributions.

Install extra packages if this isn't already done.

cython python-gtk2-dev pygtk

Build pybind

$ mkdir build
$ cd build
$ ../configure --with-python
$ make

You can now either make install and run

$ inkscape  #The binary's name needs to change soon.

Or test things first. In that case, you'll need to copy the default configuration files.

$ cp -a share /usr/loca/share/inkscape

Running

$ export PYTHONPATH=$PYTHONPATH:/path/to/pyink 
$ /path/to/pybind/build/src/inkscape