# the molmovie procedure creates an animation by # sequentially turning the molecules on and off # default is to wait a 500 miliseconds between 'frames' proc molmovie {{loops 10} {delay 500}} { global molmovie_last set nmols [molinfo num] if {![info exists molmovie_last]} { set molmovie_last [expr $nmols - 1] } for {set i 0} {$i < $loops} {incr i} { for {set n 0} {$n < $nmols} {incr n} { display update display update ui mol on $n mol off $molmovie_last set molmovie_last $n after $delay } } } # load frames as separate molecules. of course in case of psf+pdb files, # this has to be 'mol new step-1.psf ; mol addfile step-1.pdb' for {set i 1} {$i <= 200} {incr i} { mol new [format "i%03d.psf" $i] waitfor all mol addfile [format "i%03d.pdb" $i] waitfor all } # trigger auto-load of clone_reps clone_reps 0 0 if {[lsearch [info commands] clone_reps] < 0} { puts "need clone_reps installed to replace the default visualization" } else { # create a visualization for the first molecule # and then clone it upon the others. mol top 0 mol delrep 0 top mol representation Licorice 0.500000 20.000000 20.000000 mol color Name mol selection {all} mol material Opaque mol addrep top for {set i 1} {$i < [molinfo num]} {incr i} { clone_reps 0 $i } } # now disable displaying all molecules for {set i 0} {$i < [molinfo num]} {incr i} { mol off $i } # start animation molmovie 2 50