Wiki‎ > ‎

Movie Making in Chimera

posted Apr 24, 2011, 9:38 PM by Danny Xu   [ updated Apr 24, 2011, 9:43 PM ]
By Cameron Wilcock

Chimera Movie Making Tutorial

Required Software:



Step 1: Going over the functions

savepos     this function is used to save any view point/position we want  in Chimera so that             we can use it later.

fly        this function is used to move to any view point that we have saved using savpos.

        this is a very useful function that will move us from any viewpoint to another             using the morph function.

movie record    this is the function that will start recording the video. when this is running you can             record any action you perform in the chimera window.

set bg_color    nice function that sets your background color

wait        lets your code wait while a process finishes

movie stop    this will stop your movies recording

movie encode       this encodes your recording into a movie

color         this is used to color almost anything you want

scale        can zoom in and out using this

select         selects part of your pdb and highlights them

preset apply     applies certain graphic presets to your pdb

For instructions on how to use each of these functions go to the “Examples” section located at the end.

Step 3: Using the scripts

Setting Up:

Locate and open “Chimera” on your system.
This should open into your Chimera window

I find that using the IDLE window and command line tools make this much easier to copy and redo tasks.

To open the IDLE window go to your “Chimera” window and look at the top.

At the top search for “tools” towards the right of the window. click on “tools” to open a scroll down menu, at the top of the menu select “General controls” and then open your “command line” and your “IDLE window”

Step 4: Get a different view on thing

Now we are going to use the functions to make a movie.

from your “Chimera” window load a molecule or .pdb file that you want to make a movie of.
(Just select “File:” and then either “Open” or “Fetch by ID”)

now that the molecule is loaded go ahead and go to “Presets” in your “Chimera” window so that you can change how the molecule looks for better presentation.

After you are finished changing how the file looks we will start using the functions discussed above.

savepos :

The first thing we need to do is use the “savepos” function to save our positions.

Just start saving positions of the camera and getting cool displays wherever you want, for now we are just getting used to the controls, to save your view points you will type the following in your “Command line” or “IDLE”:
savepos  (x) ;  savepos  p1 . . . savepos  p2 . . . save  p90
where (x) is any letter followed by any number from a1 through z1000.
the view points don’t need to be in order but you need to remember where each view point is saved to, so its easier to just go in order from p1 up.

after you save several view points we get to play around with them a bit.


the next function we will use is a lot like the “retrieve_vp” and “move_vp” functions from vmd. we use this function to go back to any view point we’ve saved. its used by type the following in your  “Command line”:
fly (x); fly p1 . . . fly p2 . . . fly p90
where like above (x) can be any number from a1 to z1000 as long as you can remember it.

“fly” makes it very easy to see each view point we will use in our movies.

“fly” will be used a lot since it also gives you a preview of what the movie will look like when we will be done.

how “fly” works is it goes from one of our view points to the next by using morph, and then display the view changing at what ever speed you would like.

to use “fly” in your “Command line” you’ll type:
fly (s) x y;  fly p1 p3 , fly p2 p5 , fly p9 p4

where x is your starting frame, y is your ending frame. (s) is how fast it will display the frames.

it may take a few attempts until you figure out exactly how this works, but for now it makes a short display of moving from one view point to another.

(make a note that fly only moves from one view point too another, it does not go to any of the view points in between, for example fly p1 p5 will take you from view point p1 to view point p5 but it ignores view points p2,p3, and p4 since they were not specified. so If you wanted to go from p1 to p2 to p3 etc you would need to type fly p1 p2 p3 p4 etc until you got to the frame you wanted.)

For now just mess around with fly until you get a hang of how the function works.

Step 5: Making a Movie
Now the key for making a movie in Chimera is to break the process up into more and more steps, and then stringing it together into a string that we can enter into the command line.

so in order to make a simple movie we can type:

movie record; wait 10; fly 50 p1 p2 p3 p4 p5; wait 240; movie stop; movie encode output ~/Desktop/flying.mpeg

this is actually several steps all put into one line, Chimera just does each function in order, to demonstrate:

movie record framerate 10;
wait 10;
fly 50 p1 p2 p3 p4 p5;
wait 240;
movie stop;
movie encode output ~/Desktop/flying.mpeg

all we did was put all the steps into one line by separating each part with a semicolon.

to make a detailed movie all that is needed is to add more steps and a little more detail.

movie record framerate 10; wait 10; fly 50 p1 p2 p3; wait 120; fly 50 p3 p4 p5 p6; wait 180; fly 50 p6 p1; wait 60; movie stop; movie encode mformat mpeg bitrate 4000 output ~/Desktop/flying.mpeg

This concludes the Tutorial, if there are any questions feel free to e-mail me at
I will try my best to respond promptly


This sections is to help give some examples on using each function in case you are still having trouble.

savepos    “savepos x” the x can be any number from a1 - z1000 and save that number to             that specific view point

savepos 1; savepos 2; savepos 3; savepos 18

fly        “fly (x)” takes any view point you have saved using “savepos” and then                 puts your Chimera camera into that exact position.

fly p1; fly p2; fly p3; fly p18

fly        “fly (s) x y” moves from view point x to y and displays (s) amount of     frames in             between per second.

        fly 50 p2 p100; fly 200 p3 p500; fly 300 p18 p150; fly 180 p2 p87

set bg_color     changes your background color

        set bg_color green;  set bg_color pink

scale         changes zoom

        scale .8; scale 1.8; scale 2; scale .2; scale 3.8

Making the movie

movie record; rock y 3 68; wait; rock x 3 68; wait; movie stop; movie encode output ~/Desktop/