[Chimera-users] Movie Making in Chimera

Elaine Meng meng at cgl.ucsf.edu
Wed Dec 9 10:11:20 PST 2015


Hi Florian,
I agree with all that Eric said.  I was just trying to step back and get the overall sense of what you were doing…

Instead of scripting exactly the translation and rotation for each individual frame, you could try saving positions (a position includes the placements of all models and clip planes) with “savepos”.  These could be saved in a session, for example.  Then you could reset between the various saved positions and specify how many frames it should take to move between them.

For example, if you had saved both docked and undocked positions, and they were named “docked” and “undocked”, then:

reset undocked
(...would go abruptly to undocked position in a single frame)
reset docked 200
(…would then move from undocked to docked in 200 frames)

Resetting over multiple frames does an interpolation.  For greater control over intermediate states you can pass through several saved positions in a single smooth path using the “fly” command, instead of just “reset” which only considers the starting position and one end position per use of the command.

See manpages for details:
<http://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/movies.html#moviecommands>

See also the "Chimera Animations with Multiple Stages” example in the online movie-making tutorial from 2009:
<http://www.rbvi.ucsf.edu/chimera/data/tutorials/movies09/moviemaking.html>

I hope this helps,
Elaine
-----
Elaine C. Meng, Ph.D.                       
UCSF Computer Graphics Lab (Chimera team) and Babbitt Lab
Department of Pharmaceutical Chemistry
University of California, San Francisco



On Dec 8, 2015, at 10:53 AM, Eric Pettersen <pett at cgl.ucsf.edu> wrote:

> Hi Florian,
> 	I think the thing that might be confusing you is that an implicit “wait 1” is done at the end of line of a script if the commands in that line change the display (unless the last command in the line is some form of “wait” or unless the script is run via the “read” command instead of the “open” command).  Therefore the waits in this series of commands is superfluous:
> 
> move  0.9432,3.3367,-3.9733 model #1
> wait 
> move  -3.1264,-2.5812,5.6072 model #1
> wait 
> move  -2.9523,2.8959,-3.9907 model #1
> wait 
> 
> 	The other thing to know is that the various motion commands like “move” or “turn” have number-of-frames arguments.  Therefore these commands:
> 
> perframe "move  -14.0968,0.5720,-12.9560 model #1; turn y 1 model #0;" frames 1
> ~perframe
> perframe "move  -14.0968,0.5720,-12.9560 model #1; turn y 1 model #0;" frames 1
> ~perframe
> perframe "move  -14.0968,0.5720,-12.9560 model #1; turn y 1 model #0;" frames 1
> ~perframe
> perframe "move  -14.0968,0.5720,-12.9560 model #1; turn y 1 model #0;" frames 1
> ~perframe
> perframe "move  -14.0968,0.5720,-12.9560 model #1; turn y 1 model #0;" frames 1
> ~perframe
> wait 
> 
> can just be:
> 
> move  -14.0968,0.5720,-12.9560 5 model #1; turn y 1 5 model #0; wait
> 
> 	Looking at your script snippet I can’t explain why movie encoding would start before the motions are finished.  When I run your script with two sample models I opened, they stopped moving before the movie started encoding.
> 
> —Eric
> 
> 	Eric Pettersen
> 	UCSF Computer Graphics Lab
> 
> 
>> On Dec 8, 2015, at 3:59 AM, Florian Drechsler <florian.drechsler at googlemail.com> wrote:
>> 
>> Dear Chimera Support Team,
>> 
>> I have a question regarding movie making in Chimera: I would like to be able to record a movie, based on a chimera script, and have exact frame-wise control over what is recorded.
>> 
>> Chimera seems to make a funny distinction between "internal trajectory frames" and "movie frames" which I don't get. I would like a one-to-one correspondence between these, no interpolation or anything like that.
>> 
>> More precisely, I would like to be able to do the following, in strict sequential order:
>> 
>> - Load some models,
>>  - rotate one of the models,
>>  - move one of the models,
>>  - capture a movie frame of the resulting configuration,
>> and again
>>  - rotate one of the models,
>>  - move one of the models,
>>  - capture a movie frame of the resulting configuration,
>> etc.
>> 
>> I have tried using "perframe" commands, where each perframe operation comprises a "move" and a "turn" command, and has the option "frames 1". Still, I don't get exactly what I want: the resulting movie doesn't consist of the number of frames I'd expect - movie encoding seems to start before all commands have actually been executed. I can see a message saying that the movie has been finished, while things are still moving.
>> 
>> I've provided a code snippet below.
>> 
>> Moreover, rather than using "perframe", surely there must be a more elegant and natural way of enforcing sequential execution of commands, as one would expect from any normal programming language.
>> 
>> Thank you very much in advance for your help,
>> Best regards,
>> Florian Drechsler
>> 
>> --------------------------
>> 
>> Florian Drechsler
>> Universität Ulm
>> Institut für Biophysik
>> Albert-Einstein-Allee 11
>> D-89081 Ulm
>> ------------------------
>> 
>> ==============================================================
>> 
>> # This is a command file to be opened from UCSF Chimera.
>> # It loads several molecules from PDB files, and arranges them in docked conformations.
>> # These conformations are the result of a Bayesian inference carried out by FastNPS.
>> # Upon execution of this file, Chimera will generate a movie clip showing a set of docked
>> # conformations, in the manner of a flip-book.
>> 
>> # This file can be edited if any particular colour or lighting options etc. are desired.
>> 
>> 
>> # --- load PDBs ---
>> open ./2waq.pdb
>> open ./1D3U_movedtoCentrePol_noTFB.pdb
>> 
>> 
>> ##################################################################################
>> #####   E d i t a b l e    s e c t i o n    for custom viewing preferences   #####
>> #####                 (colour, lighting, background, etc.)                   #####
>> ##################################################################################
>> 
>> set bg_color white
>> 
>> color dark slate gray #0:.A-Q
>> 
>> 2dlabel create title text "Samples of configurations of docking scenario, 2WAQ vs. 1D3U" xpos 0.04 ypos 0.92 color black
>> 
>> 2dlabel create sub text "Motion does not represent dynamics" size 12 xpos 0.04 ypos 0.88 color black
>> 
>> 
>> ##################################################################################
>> #####            E n d    o f    e d i t a b l e    s e c t i o n            #####
>> ##################################################################################
>> move x 14.5577 model #1
>> move y 10.7525 model #1
>> move z 13.1320 model #1
>> windowsize 800 600
>> scale 0.8
>> movie record supersample 3
>> move  0.9432,3.3367,-3.9733 model #1
>> wait 
>> move  -3.1264,-2.5812,5.6072 model #1
>> wait 
>> move  -2.9523,2.8959,-3.9907 model #1
>> wait 
>> move  -14.0968,0.5720,-12.9560 model #1
>> 
>> perframe "move  -14.0968,0.5720,-12.9560 model #1; turn y 1 model #0;" frames 1
>> ~perframeperframe "move  -14.0968,0.5720,-12.9560 model #1; turn y 1 model #0;" frames 1
>> ~perframe
>> perframe "move  -14.0968,0.5720,-12.9560 model #1; turn y 1 model #0;" frames 1
>> ~perframe
>> perframe "move  -14.0968,0.5720,-12.9560 model #1; turn y 1 model #0;" frames 1
>> ~perframe
>> perframe "move  -14.0968,0.5720,-12.9560 model #1; turn y 1 model #0;" frames 1
>> ~perframe
>> wait 
>> move  8.4475,0.1,0.1 model #1
>> 
>> perframe "move  2.0968,0.5720,-12.9560 model #1; turn y 1 model #0;" frames 1
>> ~perframe
>> perframe "move  2.0968,0.5720,-12.9560 model #1; turn y 1 model #0;" frames 1
>> ~perframe
>> perframe "move  2.0968,0.5720,-12.9560 model #1; turn y 1 model #0;" frames 1
>> ~perframe
>> perframe "move  2.0968,0.5720,-12.9560 model #1; turn y 1 model #0;" frames 1
>> ~perframe
>> perframe "move  2.0968,0.5720,-12.9560 model #1; turn y 1 model #0;" frames 1
>> ~perframe
>> perframe "move  2.0968,0.5720,-12.9560 model #1; turn y 1 model #0;" frames 1
>> ~perframe
>> perframe "move  2.0968,0.5720,-12.9560 model #1; turn y 1 model #0;" frames 1
>> ~perframe
>> perframe "move  2.0968,0.5720,-12.9560 model #1; turn y 1 model #0;" frames 1
>> ~perframe
>> perframe "move  2.0968,0.5720,-12.9560 model #1; turn y 1 model #0;" frames 1
>> ~perframe
>> 
>> 
>> wait 
>> move  8.4475,4.5142,16.4771 model #1
>> turn z 2
>> wait 
>> move  -12.9187,-0.7126,-7.8443 model #1
>> turn z 2
>> wait 
>> move  9.5982,-3.2342,8.4843 model #1
>> turn z 2
>> wait 
>> move  3.2604,3.3466,-4.2558 model #1
>> turn z 2
>> wait 
>> move  0.5383,-1.8787,5.0346 model #1
>> turn z 2
>> wait 
>> move  -0.6887,1.1472,-2.6070 model #1
>> turn z 2
>> wait 
>> move  -0.0759,-1.7268,1.1365 model #1
>> turn z 2
>> wait 
>> move  -3.1444,0.7922,-1.0015 model #1
>> turn z 2
>> wait 
>> move  5.2841,0.0361,0.6118 model #1
>> turn z 2
>> wait 
>> movie encode docking.mp4 bitrate 10000 framerate 60
>> 
>> 
>> 
>> 
>> 
>> _______________________________________________
>> Chimera-users mailing list
>> Chimera-users at cgl.ucsf.edu
>> http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users
>> 
> 
> _______________________________________________
> Chimera-users mailing list
> Chimera-users at cgl.ucsf.edu
> http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users





More information about the Chimera-users mailing list