home *** CD-ROM | disk | FTP | other *** search
/ Visual FX for Image FX / VisualFX for Image FX 3.adf / Files / SetUp / 03 / 05.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  1997-09-11  |  6.5 KB  |  288 lines

  1. /*
  2.                                  Visual FX
  3.                                     For
  4.                                  Image FX
  5.                                SetUp Script
  6.                            Written By J.L. White
  7.  
  8.                          (C)1997 Merlin's Software
  9.  
  10. */
  11.  
  12. parse arg Num Frames
  13. options results
  14. address "IMAGEFX.1"
  15. ReDraw On
  16.  
  17.     RequestResponse "Do You Need Instructions?"
  18.     if rc = 0 then do
  19.         call Docs()
  20.         end    
  21.  
  22. if exists("libs:flyer.library") then do
  23.     if (POS('PROJECT_REXX_PORT',SHOW('Ports')) =0) then do
  24.         RequestNotify 'Flyer Must Be Running First!'
  25.         exit
  26.         end
  27.     call OpenFlyStuff()
  28.  
  29.  
  30.     Gadget.1 = 'D/110/22/120/ImageA Type/4/FLYER CLIP/FLYER STILL/FRAME/SEQUENCE'
  31.     ComplexRequest  '"Visual FX  SetUp Options"' 1 Gadget 250 60
  32.     if rc ~= 0 then do
  33.         call CloseStuff()
  34.         exit 0
  35.         end
  36.     else do
  37.         IAType = RESULT.1
  38.            end
  39.  
  40.     call GetA()
  41. end
  42. else do
  43.     Gadget.1 = 'D/110/22/120/ImageA Type/2/FRAME/SEQUENCE'
  44.     ComplexRequest  '"Visual FX  SetUp Options"' 1 Gadget 250 60
  45.     if rc ~= 0 then do
  46.         call CloseStuff()
  47.         exit 0
  48.         end
  49.     else do
  50.         IAType = RESULT.1+2
  51.            end
  52.  
  53.     call GetA()
  54. end
  55.  
  56. if FlyOn = 1 then
  57.     call CloseStuff()
  58.  
  59.     Gadget.1 = 'Select Operator For Vignette!'
  60.     Gadget.2 = 'Lighten'
  61.     Gadget.3 = 'Emboss'
  62.     Gadget.4 = 'Solarize'
  63.     Gadget.5 = 'Negative'
  64.     Gadget.6 = 'Posterize'
  65.     Gadget.7 = 'Antique'
  66.     Gadget.8 = 'Blur'
  67.     Gadget.9 = 'Darken'
  68.     ListRequest 9 Gadget
  69.     Type2 = 0
  70.     if result = 2 then Type2 = 0
  71.     if result = 3 then Type2 = 1
  72.     if result = 4 then Type2 = 2
  73.     if result = 5 then Type2 = 3
  74.     if result = 6 then Type2 = 4
  75.     if result = 7 then Type2 = 5
  76.     if result = 8 then Type2 = 6
  77.     if result = 9 then Type2 = 7
  78.  
  79.     ArgType2 = 0
  80.     if Type2 = 0 then do
  81.         RequestSlider '"Enter Brightness Of Image!"' 1 255 120
  82.         ArgType2 = Result
  83.         end
  84.     if Type2 = 7 then do
  85.         RequestSlider '"Enter Darkness Of Image!"' 1 255 120
  86.         ArgType2 = Result
  87.         end
  88.  
  89.     AlphaName = "VFXIFX:Images/Brushes/Vignette"
  90.  
  91.     Gadget.1 = ' Select Alpha Type! '
  92.     Gadget.2 = ' Use Default Image '
  93.     Gadget.3 = ' User Selected Image '
  94.     Gadget.4 = ' User Selected Sequence '
  95.     ListRequest 4 Gadget
  96.     AType = 0
  97.     if result = 2 then AType = 0
  98.     if result = 3 then AType = 1
  99.     if result = 4 then AType = 2
  100.  
  101.     if AType = 1 then do
  102.         RequestFile '"Select File For Alpha Channel!" "RAM:" ""'
  103.         AlphaName = result
  104.         end
  105.  
  106.     if AType = 2 then do
  107.         RequestFile '"Select Path & BaseName For Alpha Channel!" "RAM:" ""'
  108.         AlphaName = result
  109.         end
  110.  
  111. call open TempFile,"VFXIFX:TempDrawer/"strip(Num),W
  112. call writeln TempFile,PicAName
  113. call writeln TempFile,Start
  114. call writeln TempFile,End
  115. call writeln TempFile,IAType
  116. call writeln TempFile,Type2
  117. call writeln TempFile,ArgType2
  118. call writeln TempFile,AlphaName
  119. call close TempFile
  120. exit
  121.  
  122.  
  123.  
  124. GetFile:
  125.     parse Arg Title, Path
  126.     Address FLY_1 SetString Path
  127.     Address FLY_1 GetFileNameNT Title
  128. return result
  129.  
  130. GetFileName: procedure  
  131.    parse ARG CompleteName
  132.    c = lastpos("/",CompleteName)
  133.    if c = 0 then c = lastpos(":",CompleteName)
  134.    return substr(CompleteName, c + 1)
  135.  
  136.  
  137. GetA:
  138.  if IAType = 0 then do
  139.     call Switcher(TOSW)
  140.     PicAName = GetFile("Select Flyer Clip For ImageA!  ",DriveName)
  141.     Name = GetFileName(PicAName)
  142.     if Name = "" then do
  143.         Address FLY_1 OK_TEXT " OK "
  144.         Title = "You Must Enter A Valid Clip Name To Use!"
  145.         Address FLY_1 FYINT Title
  146.         Address FLY_1 Quit
  147.         call Switcher(TOWB)
  148.         exit
  149.         end
  150.     Address FLY_1 SetFileName PicAName
  151.     Address FLY_1 GetClipLength PicAName
  152.     End = result
  153.     Start = 0
  154.     Address FLY_1 Program "5"
  155.     Address FLY_1 StartNum Start
  156.     Address FLY_1 EndNum End
  157.     Address FLY_1 CurrentNum "0"
  158.     Address FLY_1 GetTimeNT "Select A Range Of Frames To Process!"
  159.     Start = word(result,1)*2
  160.     End = word(result,2)*2
  161.     Start  = Start + 1
  162.     End = End +2
  163.     call addlib('PROJECT_REXX_PORT' , 0)
  164.     call addlib(TOASTERLIB,0)
  165.     call Switcher(TOWB)
  166.     address command "C:Wait 1"
  167.     ScreenToFront
  168.     end
  169.    if IAType = 1 then do
  170.     RequestFile '"Select Flyer Still For ImageA!"' DriveName ' '
  171.     PicAName = result
  172.     Name = GetFileName(PicAName)
  173.     if Name = "" then do
  174.         Title = "You Must Enter A Valid Name To Use!"
  175.         RequestNotify Title
  176.         if FlyOn = 1 then Address FLY_1 Quit
  177.         exit
  178.         end
  179.     RequestNumber '"Enter Number Of Frames To Process!"' Frames
  180.     End = result
  181.     Start = 1
  182.     end
  183.    if IAType = 2 then do
  184.     RequestFile '"Select FileName For ImageA!"' 'SYS:' ' '
  185.     PicAName = result
  186.     Name = GetFileName(PicAName)
  187.     if Name = "" then do
  188.         Title = "You Must Enter A Valid Name To Use!"
  189.         RequestNotify Title
  190.         if FlyOn = 1 then Address FLY_1 Quit
  191.         exit
  192.         end
  193.     RequestNumber '"Enter Number Of Frames To Process!"' Frames
  194.     End = result
  195.     Start = 1
  196.     end
  197.    if IAType = 3 then do
  198.     RequestFile '"Select BaseName For ImageA! "' 'SYS:' ' '
  199.     PicAName = result
  200.     Name = GetFileName(PicAName)
  201.     if Name = "" then do
  202.         Title = "You Must Enter A Valid Name To Use!"
  203.         RequestNotify Title
  204.         if FlyOn = 1 then Address FLY_1 Quit
  205.         exit
  206.         end
  207.     RequestNumber '"Enter Number Of Frames To Process!"' Frames
  208.     End = result
  209.     Start = 1
  210.     end
  211. return
  212.  
  213. CloseStuff:
  214.     Address FLY_1 Quit
  215.     call remlib('ToasterARexx.port')
  216.     call remlib('PROJECT_REXX_PORT')
  217. return
  218.  
  219.  
  220.  
  221. OpenFlyStuff:
  222.     FlyOn = 1
  223.     address command "run VFXIFX:FLY" 
  224.     do while (POS('FLY_1',SHOW('Ports')) = 0)
  225.         address command "wait 1"
  226.         end
  227.     TOASTERLIB="ToasterARexx.port"
  228.     call remlib('ToasterARexx.port')
  229.     call remlib('PROJECT_REXX_PORT')
  230.     call addlib('PROJECT_REXX_PORT' , 0)
  231.     call addlib(TOASTERLIB,0)
  232.     DriveName = FindDrive()
  233. return
  234.  
  235.  
  236. FindDrive:
  237.     address command "C:Info >RAM:DriveList"
  238.     call open TempFile,"RAM:DriveList",R
  239.     do until eof(TempFile)
  240.         line = readln(TempFile)
  241.         parse var line Drive" "Rest
  242.         if Drive = "FA0:" then 
  243.             FlyVolume = word(Rest,7)":"
  244.     end
  245.     call close TempFile
  246.     address command "Delete >NIL: RAM:DriveList"
  247. return FlyVolume
  248.  
  249.  
  250.  
  251. LoadA:
  252.     if IAType = 0 then do
  253.         LoadBuffer PicAName Force i
  254.         end
  255.     if IAType = 1 then do
  256.         LoadBuffer PicAName Force 1
  257.         end
  258.     if IAType = 2 then do
  259.         LoadBuffer PicAName Force
  260.         end
  261.     if IAType = 3 then do
  262.         LoadBuffer PicAName""right(i,3,'0') Force
  263.         end
  264. return
  265.  
  266.  
  267.  
  268. Docs:
  269.  
  270.     text1 = '"This effect takes an image and creates a vignette"'
  271.     text2 = '"type of an effect. The center of the image is left"'
  272.     text3 = '"alone, but the edges are blurred, solarized, darkened,"'
  273.     text4 = '"etc. which will give it a hazy dream kind of look."'
  274.     text5 = '"The vignette is based on a B&W alpha image which you"'
  275.     text6 = '"can use the default image, another image or sequence."'
  276.  
  277.     Gadget.1  = 'TEXT LE=10 TE=4 LB='text1' '
  278.     Gadget.2  = 'TEXT LE=10 TE=14 LB='text2' '
  279.     Gadget.3  = 'TEXT LE=10 TE=24 LB='text3' '
  280.     Gadget.4  = 'TEXT LE=10 TE=34 LB='text4' '
  281.     Gadget.5  = 'TEXT LE=10 TE=44 LB='text5' '
  282.     Gadget.6  = 'TEXT LE=10 TE=54 LB='text6' '
  283.     Gadget.7 = 'END'
  284.     NewComplexRequest  '"Instructions For Effect #05"' Gadget 400 66
  285.  
  286. return
  287.  
  288.