home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD1.iso / GFX / Raytracing / Objects / TAI-HFX1.LHA / FLYER.LZH / GETIMG.REXX < prev    next >
Encoding:
OS/2 REXX Batch file  |  1995-03-31  |  1.6 KB  |  74 lines

  1. /* FILE: GETIMG.REXX - Gets the first image from a Flyer Clip */
  2.  
  3. options results
  4. TOASTERLIB="ToasterARexx.port"
  5.  
  6. /*** Get files and frame number from command line ***/
  7.  
  8. PARSE ARG clipname ',' frame ',' outname
  9.  
  10. /*** Exit LightWave ***/
  11.  
  12. ADDRESS 'LightWaveARexx.port'
  13. 'EnterSwitcher'
  14.  
  15. /*** Call command in separate process to start ToasterPaint ***/
  16. ADDRESS COMMAND
  17. 'WAIT 1'
  18. 'RUN >NIL: RX HFX:FLYER/STARTTP'
  19. 'WAIT 5'
  20.  
  21. /*** Send commands to ToasterPaint to extract the image ***/
  22.  
  23. ADDRESS 'DigiPaint'
  24.  
  25. /* Set input clip */
  26. 'Slcp'
  27. Call SetFile(clipname)
  28.  
  29. /* Grab the frame */  
  30. 'Gnfm'
  31.  
  32. /* Save frame as 24 bit file */
  33. Call SaveRGB(outname)
  34.  
  35. /*** Quit ToasterPaint, return to Switcher ***/
  36. 'Quit'
  37.  
  38. /*** Run external program to Return to LightWave (won't exit till LightWave exits) ***/
  39.  
  40. ADDRESS COMMAND
  41. 'WAIT 1'
  42. 'RUN >NIL: RX HFX:FLYER/STARTLW'
  43. 'WAIT 2'
  44. exit
  45.  
  46.  
  47. SetFile: PROCEDURE        /* Select file in current requester */
  48.   arg file
  49.   dirname=GetPathName(file)
  50.   'Dnam'dirname              /* Enter file path  */
  51.   filename=GetFileName(file)
  52.   'Fnam'filename             /* Enter File name  */
  53.   'Okls'                     /* Hit the OK button  */
  54.   return
  55.  
  56. SaveRGB: PROCEDURE   
  57.   arg filename
  58.   'Sa24'        /* Call file requester  */
  59.     Call SetFile(filename)
  60.   return
  61.  
  62. GetFileName: procedure  /* Extract file name from full file specification */
  63.   ARG fullfile
  64.   c = lastpos("/",fullfile)
  65.   if c = 0 then c = lastpos(":",fullfile)
  66.   return substr(fullfile, c + 1)
  67.  
  68. GetPathName: procedure  /* Extract directory name from full file specification */
  69.   ARG fullfile
  70.   c = lastpos("/",fullfile)
  71.   if c = 0 then c = lastpos(":",fullfile)
  72.   return left(fullfile,c)
  73.  
  74.