home *** CD-ROM | disk | FTP | other *** search
/ DTP Toolbox / DTPToolbox.iso / utilities / propage_pdraw / donsgenies / scriptsforimagemaster / parfire.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  1995-06-19  |  3.4 KB  |  150 lines

  1. /* Animated fire script for ImageMaster and PAR. Don Cox, June 95
  2.  */
  3. options results
  4.  
  5. call open("STDERR","ram:tracePFire","W")
  6. trace r
  7.  
  8. if show('P','IM_Port') = 0 then do
  9.     say "Can't find image processor's ARexx port!!!"; /* not running? */
  10.     say "This script requires ImageMaster to run!";
  11.     exit(20);
  12.     end;
  13.  
  14. call pragma('stack',20000);
  15.  
  16. address DDR
  17. mode ANIM
  18.  
  19. address 'IM_Port'
  20. 'imtofront'; /* show user the IM screen */
  21.  
  22. 'filerequest "DDR:" "" "" "Final Video file"'
  23. PARoutputfile = result
  24. if PARoutputfile = 'FR_CANCELLED' then do
  25.     address 'IM_Port'
  26.     'imtofront'
  27.     exit 0
  28.     end
  29. PARoutputfile = expandfilename(PARoutputfile)
  30. PARoutputpath = gimmepath(PARoutputfile)
  31. parse var PARoutputpath PARoutputpath PARoutputname
  32. PARoutputname = strip(PARoutputname)
  33.  
  34. 'asknumber "How many frames?" 50'
  35. nframes = result
  36.  
  37. 'rectarea' 
  38.  
  39. bred = 0
  40. bgrn = 40
  41. bblu = 230
  42.  
  43. mred = 255
  44. mgrn = 250
  45. mblu = 190
  46.  
  47. ered = 255
  48. egrn = 235
  49. eblu = 0
  50.  
  51. tred = 115
  52. tgrn = 57
  53. tblu = 0
  54.  
  55. length = 450
  56. direction = 0
  57. seed = 8
  58. hstruct = 12
  59. hturb = 50
  60. vstruct = 5
  61. vturb = 100
  62. wobble = 10
  63. wobamt = 50
  64. distort = 100
  65.  
  66. address 'IM_Port'
  67. 'current'
  68. buffdata = result
  69. parse var buffdata bname ',' bnum ',' bx ',' by ',' btot ',' bmem ',' bparname ',' bparnum
  70.  
  71. do i = 1 to nframes 
  72.     time = (i-1) * (360/nframes)
  73.     'fire 'bred bgrn bblu mred mgrn mblu ered egrn eblu tred tgrn tblu length direction time seed hstruct hturb vstruct vturb wobble wobamt distort;
  74.     'save 'bnum '"'||PARoutputfile||'"'
  75.     'undo'
  76.     end
  77.  
  78. wayout("Done - now name new PAR anim")
  79.  
  80.  
  81. wayout:
  82. address 'IM_Port'
  83. 'autoredraw 1'  /* ON */
  84.  
  85. parse arg infomessage
  86. if infomessage ~= "" then do
  87.     address 'IM_Port'
  88.     'message 'infomessage
  89.     end
  90. address DDR
  91. TOFRONT
  92. Mode r_Mode
  93. EMode r_EMode
  94. Filter r_filter
  95. Translate r_Translate
  96. Exporter r_Exporter
  97. Done
  98. exit 0
  99. end
  100.  
  101. /* +++++++++++++++++++++++++++++++  +++++++++++++++++++++++++++++++++++++ */
  102.  
  103. /* gimmepath
  104.  This takes the provided argument and sucks the path out of it, then returns that path to the caller, sans file name. */
  105.  
  106. gimmepath:
  107.   parse arg fullnamegx;
  108.     tempgx = reverse(fullnamegx);
  109.     lengx = length(fullnamegx);   /* get length of string */
  110.     slashdex = index(tempgx,'/'); /* first occurance of '/' from right */
  111.     colondex = index(tempgx,':');  /* first occurance of ':' from right */
  112.     seploc = 0; /* assumes current dir, no path supplied */
  113.     if slashdex ~= 0 then do /* we assume we are in a DIR */
  114.       seploc = (lengx - slashdex)+1;
  115.       end;
  116.     else do
  117.       if colondex ~= 0 then do /* we assume we are on a device */
  118.         seploc = (lengx - colondex)+1;
  119.         end;
  120.       end;
  121.   gxname = substr(fullnamegx,seploc+1); /* if you ever need it */
  122.   gxpath = left(fullnamegx,seploc)
  123.   gxpath = gxpath" "gxname
  124.   return(gxpath);
  125.  
  126.  
  127. /* +++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++ */
  128.  
  129. /*
  130.  * Since this script can't be expected to know where the CD of the user
  131.  * is when this cmd is invoked, we have to check the path the user
  132.  * provides - if it's not specified right from a root, then we have
  133.  * to make it a complete specification from the root.
  134.  */
  135. expandfilename:
  136.   parse arg jfile;
  137.   if index(jfile,':') = 0 then do
  138.     curdir = pragma(D);
  139.     if right(curdir,1) ~= ':' then do
  140.       if right(curdir,1) ~= '/' then do
  141.         if curdir ~= '' then do
  142.           curdir = curdir || '/';
  143.           end;
  144.         end;
  145.       end;
  146.     jfile = curdir||jfile;
  147.     end;
  148.   return(jfile);
  149.  
  150.