Endonuclease PvuII (1PVI) DNA - GATTACAGATTACA
CAP - Catabolite gene Activating Protein (1BER)
DNA - GATTACAGATTACAGATTACA Endonuclease PvuII bound to palindromic DNA recognition site CAGCTG (1PVI) DNA - GATTACAGATTACAGATTACA TBP - TATA box Binding Protein (1C9B)
CAP - Catabolite gene Activating Protein (1BER)
GCN4 - leucine zipper transcription factor bound to palindromic DNA recognition site ATGAC(G)TCAT (1YSA)
GCN4 - leucine zipper transcription factor bound to palindromic DNA recognition site ATGAC(G)TCAT (1YSA)
GCN4 - leucine zipper transcription factor bound to palindromic DNA recognition site ATGAC(G)TCAT (1YSA)
GCN4 - leucine zipper transcription factor bound to palindromic DNA recognition site ATGAC(G)TCAT (1YSA)
GCN4 - leucine zipper transcription factor bound to palindromic DNA recognition site ATGAC(G)TCAT (1YSA)
TBP - TATA box Binding Protein (1C9B)
 

° 

Movies can wait for a specified time or until you press a button

The probably most crucial command in a movie is Wait, which waits for a given condition and updates the screen while waiting .

Normally, YASARA redraws the screen after each command. This is convenient when working interactively, but it is not what you want in a movie, because often more than one command is needed to do something. If the intermediate steps were all shown on screen, this would be very annoying. Consequently YASARA stops updating the screen as soon as the console is switched off.

It is then your duty to tell YASARA that the macro has reached a point where it can be held to update the screen. This is achieved with the Wait command:

Wait 1
Wait for one screen update, then continue
Wait 60
Wait for 60 screen updates (= 1 second if FramesPerSec is 60)
Wait LeftButton
Wait for a click on the left mouse button
Wait RightButton
Wait for a click on the right mouse button
Wait ContinueButton
Display a continue button and wait for a click

While the macro is waiting, all automatic movements or rotations continue normally:


Console off
LoadPDB 1crn
# Start an automatic rotation in steps of 2 degrees about the Y-axis
AutoRotateObj 1crn,Y=2
# Wait for 180 screen updates (=360/2, one full rotation of 1crn)
Wait 180
# And stop after one full rotation
AutoRotateObj 1crn,Y=0

Alternatively, this macro would do the same:


Console off
LoadPDB 1crn
# Run 180 single rotation steps in a loop
for i=1 to 180
  RotateObj 1crn,Y=2
  Wait 1

Nevertheless, the first macro is the preferred one, because it allows YASARA to speedup the rotation on slow computers: if the graphics card is not capable of displaying 180 rotation steps fast enough, YASARA may decide to show only 90 and rotate 1crn in steps of four instead of two degrees.

Waiting for a pressed button is helpful for tutorials and talks. However, you maybe want two different versions of your movie: one which you can use during your talk, and one which actually displays the things you want to say on screen, so that people who missed your talk can download the movie instead. The second one would then also use a 'ContinueButton', so that the audience can e.g. rotate a protein structure before continuing.

This can be achieved with the 'Help' flag. If a movie is run via Help > Play help movie, the variable 'Help' is set to 1. You can therefore start a movie with the following code:


if Help
  # If we are showing a help movie, wait for clicks on the ContinueButton
  button='ContinueButton'
else
  # Otherwise just wait for a click on the left mouse button
  button='LeftButton'

And then use

Wait (button)

to wait for the button you selected above.

If you want, add your text:

if Help
  ShowMessage "Welcome everyone to my first YASARA movie. Today, I will tell you about.."