Wait suspends command processing for the given number of wait_frames. It is used:
• to enforce the ordered rather than simultaneous execution of commands in scripts and demos
• to generate duplicate image frames in movies
See also: sleep, pause, movie-related commands
When the number of wait frames is not specified, wait suspends command processing until certain commands have finished. For example, in the following, wait prevents the rock from starting until the roll has finished:
roll y 3 120; wait
rock x 2 68
It is also acceptable to give the frame argument where it could have been omitted. The following is equivalent to the first example:
roll y 3 120; wait 120
rock x 2 68
Wait without arguments will automatically wait for the following multi-frame commands to finish: move, turn, rock, roll, scale, clip, thickness, section, reset, fly, 2dlabels visibility changes. Other multi-frame commands require the second approach (specifying the appropriate number of wait frames) to enforce their ordered execution: coordset, perframe, play, scene, transparency, volume planes playback, vop morph, and others.
A shorter wait can be applied to allow overlapping but staggered execution, for example:
2dlab change title2 visibility show frames 20; wait 10
coordset #2 1,26,1; wait 26
When a command script is executed, a single-frame display update (implicit wait 1) will be added at the end of each line that: (a) contains one or more commands that could change the display, and (b) does not already end with an explicit wait of any length. (Exception: display updates are not added when a script is executed with read.)
Stretches of duplicate image frames correspond to periods of time where objects remain static. If motion occurs in the last few frames of a movie, due to the encoding process it may appear to end on a blur. This effect can be avoided by including a few wait frames (wait 5 or similar) at the end of scripted movie content.