The following Rivl procedure makes a transition from one movie to another by "pushing" the first one out with the second one.
proc mover {image w h p} {
im_trans! image [expr $w * $p] [expr $h * $p]
return $image
}
proc mover2 {image w h p} {
im_trans! image [expr $w * [expr 1-$p]] [expr $h * [expr 1-$p]]
return $image
}
proc MoveOver {movieA movieB horizontal vertical} {
set width [expr [seq_width $movieA]*$horizontal]
set height [expr [seq_height $movieB]*$vertical]
# Movie moving out
set leaving [seq_map $movieA "mover %1 $width $height %p"]
set width [expr -1*$width]
set height [expr -1*$height]
# Split second movie
set coming1 [seq_setlength $movieB [seq_length $movieA]]
set coming2 [seq_clip $movieB [seq_length $movieA] [seq_length $movieB]]
# Movie moving in
set coming [seq_map $coming1 "mover2 %1 $width $height %p"]
seq_overlay $leaving $coming $coming2
}
The horizontal and vertical variables allow the user to adjust from which side the new movie should come from, be that the top, bottom, left or right (or from one of the corners). Setting horizontal to 1 and vertical to 0 will make the new movie come in from the left. If horizontal were -1 the new movie would come in from the right. Setting
horizontal to 0 and vertical to 1 will make the new movie come in from the top. If vertical were -1 the new movie would come in from the bottom.
The first procedure mover moves the movie, one image at a time, using im_trans out of the frame. move2 pushes the movie in to the frame. The main procedure MoveOver first creates the movie moving out. It then splits the second movie into two parts; the first part being the same length as the movie that will be pushed out, and the second part being blank for this length and then showing the rest of the movie not showed in the first part. It then creates the movie (from the first part of the second movie) that will move in to the frame. Finally it puts the three pieces together using seq_overlay.