#!/usr/bin/perl # # Makes an executable file to record Partiview movies. # # Usage: perl makemoviescript.pl execfile N [E] # # execfile = the executable file you can call with 'async execfile' in Partiview. # N = the number of snapshots this will take. # E = once every how many snapshots it Partiview reports a location using 'where' # while recording. Default = 1. # # # Dinoj Surendran 12 Feb 03 dinoj@cs.uchicago.edu if (( -t STDIN && @ARGV == 0 ) || ($#ARGV > 2)) { print STDERR " Usage: perl $0 execfile N [E] execfile = the executable file you can call with 'async execfile' in Partiview. N = the number of snapshots this will take. E = once every how many snapshots it Partiview reports a location using 'where' while recording. If not supplied, no locations are reported. "; exit(1); } $scriptfile = $ARGV[0]; $numsteps = $ARGV[1]; $every = 1; $every = $ARGV[2] if ($#ARGV == 2); open (OUT, ">$scriptfile"); print OUT "\#! /bin/csh -f \n\#\n"; for (my $i=0; $i<$numsteps; $i++) { my $askwhere = ""; if ( ($every > 0) && (($i % $every) == 0) ) { $askwhere = "echo where\n"; } my $cmd = sprintf("echo step %0.4f\necho update\necho snapshot\n%s", 1.0*$i/10000,$askwhere); print OUT $cmd; } close (OUT); system ("chmod 755 $scriptfile");