[Chimera-users] Movie Making in Chimera

Eric Pettersen pett at cgl.ucsf.edu
Tue Dec 8 10:53:14 PST 2015


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
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://plato.cgl.ucsf.edu/pipermail/chimera-users/attachments/20151208/ace10b8b/attachment-0001.html>


More information about the Chimera-users mailing list