Skip to content
Geo Maciolek edited this page Nov 10, 2022 · 5 revisions

Flam3 Animation

Using flam3-genome to create multiple steps of an animation

Consider a file with multiple flames, call them A, B, and C. Animating this file will generate interpolated flame genomes that loop and transition from each flame to the next - for example, it would first loop the A flame, then transition from A to B, then loop the B flame, transition from B to C, and then finally loop the C flame. If the file that contains the flames A, B, and C is called ABC.flame, then the following command will generate the frames for the animation:

env sequence=ABC.flame nframes=30 flam3-genome > ABC_anim.flame

The nframes=30 in this command means that each loop will consist of 30 frames, and each transition between loops will be 30 frames as well. Since the there will be 360 degrees of rotation in the 30 frames, the animation may not seem continuous (large angular jumps) - this can be solved by using a larger value for nframes. Note that if you only want to generate the transitions between the flames and not the loops, add loops=0 to the command.

See also: biomorphica.com/apophysis/animTutorial (archive.org mirror)

Rendering multiple flames into multiple still images

To render all of these flames to individual images with motion blur use flam3-animate. To generate the animation as a series of static images, you could use:

env prefix=ABC format=jpg jpeg=95 flam3-animate < ABC_anim.flame

If present, the prefix will be attached to every rendered image's filename (ABC0000.jpg, ABC0001.jpg, etc.) The jpeg number is the JPEG quality factor to use when storing the images. You can also use the PNG or PPM formats. You can also substitute flam3-render for flam3-animate but without motion blur your animation will suffer from strobing and other temporal aliasing.

Creating a movie

Once you have created a whole bunch of still frame files, you need to use a video tool to combine them all into a video file (i.e. MPEG, avi, Windows Media file or Quicktime). Adobe Premiere will do this (Import Files) or use a free Windows program VirtualDub

For example, to use the freely available, open source MPlayer mencoder (available for Mac, and linux), you can use the following command line to generate the movie in .avi format:

mencoder mf:///home/username/path/to/images/*.jpg -mf fps=30 -ovc lavc -o output.avi

Template files

To recreate the motion blurred frames used by the Electric Sheep Screensaver, we should introduce the concept of a template file. A template file contains settings that you would like to apply to the output of the flam3-genome utility - think of it as an overrides file. You can override most of the settings that are available in the <flame> element of the genome. This allows you to ensure that the same settings will be used for all frames in the generated series. As an example, standard flames generated by Apophysis have temporal_samples set to 1.

We would like our animation to have temporal_samples=200, and also set the quality factor to 500. We can easily do this by creating a template flame file (call it anim_template.flame) with the following contents:

<flame temporal_samples="200" quality="500" />

Then when we call flam3-genome, these default values will override the values in the source flame. Here's how it's used: let's say we're going to loop a flame called A.flame. The following command will generate motion blur genomes for a 200-frame loop of A:

env template=anim_template.flame sequence=A.flame nframes=200 flam3-genome > A_anim.flame

The result will be a flame file with 200 separate genomes, one for each time step in the animation. To render all of these frames with motion blur, we would type

env in=A_anim.flame prefix=Aframe flam3-animate

Rendering a single frame

If you only want to render one of the frames in the series, you can specify frame= or time= in the env variable listing. Note that when rendering with flam3-animate, time is blurred +/- 0.5 time steps for each image.