home *** CD-ROM | disk | FTP | other *** search
- /* FILE: GETIMG.REXX - Gets the first image from a Flyer Clip */
-
- options results
- TOASTERLIB="ToasterARexx.port"
-
- /*** Get files and frame number from command line ***/
-
- PARSE ARG clipname ',' frame ',' outname
-
- /*** Exit LightWave ***/
-
- ADDRESS 'LightWaveARexx.port'
- 'EnterSwitcher'
-
- /*** Call command in separate process to start ToasterPaint ***/
- ADDRESS COMMAND
- 'WAIT 1'
- 'RUN >NIL: RX HFX:FLYER/STARTTP'
- 'WAIT 5'
-
- /*** Send commands to ToasterPaint to extract the image ***/
-
- ADDRESS 'DigiPaint'
-
- /* Set input clip */
- 'Slcp'
- Call SetFile(clipname)
-
- /* Grab the frame */
- 'Gnfm'
-
- /* Save frame as 24 bit file */
- Call SaveRGB(outname)
-
- /*** Quit ToasterPaint, return to Switcher ***/
- 'Quit'
-
- /*** Run external program to Return to LightWave (won't exit till LightWave exits) ***/
-
- ADDRESS COMMAND
- 'WAIT 1'
- 'RUN >NIL: RX HFX:FLYER/STARTLW'
- 'WAIT 2'
- exit
-
-
- SetFile: PROCEDURE /* Select file in current requester */
- arg file
- dirname=GetPathName(file)
- 'Dnam'dirname /* Enter file path */
- filename=GetFileName(file)
- 'Fnam'filename /* Enter File name */
- 'Okls' /* Hit the OK button */
- return
-
- SaveRGB: PROCEDURE
- arg filename
- 'Sa24' /* Call file requester */
- Call SetFile(filename)
- return
-
- GetFileName: procedure /* Extract file name from full file specification */
- ARG fullfile
- c = lastpos("/",fullfile)
- if c = 0 then c = lastpos(":",fullfile)
- return substr(fullfile, c + 1)
-
- GetPathName: procedure /* Extract directory name from full file specification */
- ARG fullfile
- c = lastpos("/",fullfile)
- if c = 0 then c = lastpos(":",fullfile)
- return left(fullfile,c)
-
-