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 (
y), polynomial and simple harmonic motion ("elastic") are implemented for interpolation in time (
t). But you can define whatever function you want.)
Yet Another Interpolator includes an ipython interpreter so that you can programmatically (and instantly)
- Alter the XML tree representing the SVG file being edited.
- Alter the GTK+ user interface. Add buttons, keyboard shortcuts, etc
- Alter YAI's own code (requires a reload but no program restart).
More features coming soon, possibly.
With YAI as editor and renderer
- Create a path (using the pen or pencil tool).
- Change this path's
mypath-0. To quickly do this, change the entry of text box below the frame table next to Set to
mypath-0and then click Set.
- Click Track. A new row labelled
- Click on the only filled cell (row
0). The cell turns cyan.
Mark. The cell should turn purple.
- Click on the cell next to it (row
Paste. This creates a new path named
- Edit this newly created path (move it around, change its points and handles, change fill and stroke hues and opacity).
- Drag the slider next to the
Interpolatebutton. You should see a path move (progressively transform) from the first path you created the second path you created.
wrap.animator.anim(0.5)in the ipython interpreter. This has the same effect as moving the slider to the midpoint.
wrap.animator.run(1.0)in the ipython interpreter. This will move the slider from
With YAI as a renderer only
- Create 2 paths with the same number of nodes however you want.
- Change the
idof one path to
idof the other path to
- Select one of the paths and click
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.
Since this is an Inkscape fork, everything for compiling Inkscape itself is needed. See Compiling Inkscape on the Inkscape Wiki.
- Cython >= 1.8 (?)
- Python header files (for your version of Python. Currently YAI works with Python 2.x only.)
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
$ 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
$ export PYTHONPATH=$PYTHONPATH:/path/to/pyink $ /path/to/pybind/build/src/inkscape