home *** CD-ROM | disk | FTP | other *** search
- /* ConvertAnim.rx © by Helmut Hoffmann 1995 */
- /* Make HHsYUVSq animation from another animation format */
- /* with ImageFX or EGSImageFX */
-
- OPTIONS RESULTS
-
- CLOSE(STDERR)
- win=OPEN(STDERR,'NIL:')
-
- if ~(ADDRESS()='REXX') then do
- CLOSE(STDOUT)
- win=OPEN(STDOUT,'CON:0/50//130/ConvertAnim.rx/CLOSE')
- win=OPEN(STDERR,'NIL:')
- end
- else do
- if ~SHOW('p','IMAGEFX.1') then do
- if ~SHOW('p','EGS_IMAGEFX.1') then do
- say "This script needs a running ImageFX or EGSImageFX"
- say "and HHsFastIFXModules (the saver) to convert animations"
- exit
- end
- else ifxport='EGS_IMAGEFX.1'
- end
- else ifxport='IMAGEFX.1'
- address value ifxport
- end
-
- 'GetPrefs LoadPath'
- LoadPath=result
- 'GetPrefs SavePath'
- SavePath=result
-
- address command 'requestfile drawer "'LoadPath'" noicons title "Select source animation:" >ENV:HHsYUVAnimSource'
- if rc~=0 then exit
- address command 'requestfile drawer "'SavePath'" savemode noicons pattern ~(#?.info) title "Select destination animation file:" >ENV:HHsYUVAnimFile'
- if rc~=0 then exit
-
- if (open(SourceList,'ENV:HHsYUVAnimSource','READ')=0) then do
- say "Can't read source file name"
- exit
- end
- if (open(DestList,'ENV:HHsYUVAnimFile','READ')=0) then do
- say "Can't read dest file name"
- exit
- end
-
- destanim=READLN(DestList)
- say "Creating animation:" destanim
-
- sourceanim=READLN(SourceList)
- say "Source animation:" sourceanim
- 'LoadBuffer 'sourceanim' force Frame' 0
- if rc=0 then do
- say "Source is no suitable animation file!"
- address command 'wait 5'
- exit
- end
-
- frame=1
- DO FOREVER
- say "Processing frame" frame
- 'LoadBuffer 'sourceanim' force Frame' frame
- if rc~=0 then exit
- 'GetMain'
- if rc~=0 then exit
- parse var result '"' bufname '"' xdim ydim more
- if (frame=1) then say "Size:" xdim ydim
- scalefac=min(36000/xdim,31000/ydim)
- if (scalefac<100) then do
- say "Downscaling:" scalefac||"%"
- 'Scale 'scalefac scalefac ' percent'
- if rc~=0 then do
- say "Scaling failed!"
- exit
- end
- end
-
- 'SaveBufferAs Format "-HHsYUVSq animation-" File 'destanim
- if rc~=0 then exit
- frame=frame+1
- END
-
-