home *** CD-ROM | disk | FTP | other *** search
/ Visual FX for Image FX / VisualFX for Image FX 3.adf / Files / SetUp / 03 / 20.rexx < prev   
Encoding:
OS/2 REXX Batch file  |  1997-08-22  |  5.7 KB  |  245 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. Quotes = '27'X
  16. DQuotes = '22'X
  17.     ReDraw On
  18.     RequestResponse "Do You Need Instructions?"
  19.     if rc = 0 then do
  20.         call Docs()
  21.         end    
  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.     i = Start
  60.     call LoadA()
  61.  
  62.     NumA = 1
  63.     NumB = 100
  64.     NumC = 10
  65.     RequestSlider '"Enter Speed Of Flame Movement!"' NumA NumB NumC
  66.     Speed = Result
  67.     call open TempFile,
  68.     call writeln TempFile,Speed
  69.     call close TempFile
  70.     RequestNotify "Make Sure You Set The Increment Number To 0!"
  71.     Learn "RAM:FIRE.ifx" NoHeader Quiet Force
  72.     Hook "Hooks/Sys/Fire"
  73.     Learn Stop Quiet Force
  74.     address command "Copy Ram:Fire.ifx to VFXIFX:TempDrawer/FireInfo."left(Num,2,'')
  75.     address command "Delete Ram:Fire.ifx"
  76.  
  77. call open TempFile,"VFXIFX:TempDrawer/"strip(Num),W
  78. call writeln TempFile,PicAName
  79. call writeln TempFile,Start
  80. call writeln TempFile,End
  81. call writeln TempFile,IAType
  82. call writeln TempFile,Speed
  83. call close TempFile
  84. exit
  85.  
  86.  
  87. LoadA:
  88.     if IAType = 0 then do
  89.         LoadBuffer PicAName Force i
  90.         end
  91.     if IAType = 1 then do
  92.         LoadBuffer PicAName Force 1
  93.         end
  94.     if IAType = 2 then do
  95.         LoadBuffer PicAName Force
  96.         end
  97.     if IAType = 3 then do
  98.         LoadBuffer PicAName""right(i,3,'0') Force
  99.         end
  100. return
  101.  
  102. Docs:
  103.     text1 = '"This effect uses the Fire hook to add flames to your"'
  104.     text2 = '"image. It will first ask you the speed of the flame"'
  105.     text3 = '"movement, then it will bring up the Fire requester"'
  106.     text4 = '"and let you set it any way you want. It records what"'
  107.     text5 = '"options you select and plays them back with the new"'
  108.     text6 = '"speed settings changed over each frame."'
  109.  
  110.     Gadget.1  = 'TEXT LE=10 TE=4 LB='text1' '
  111.     Gadget.2  = 'TEXT LE=10 TE=14 LB='text2' '
  112.     Gadget.3  = 'TEXT LE=10 TE=24 LB='text3' '
  113.     Gadget.4  = 'TEXT LE=10 TE=34 LB='text4' '
  114.     Gadget.5  = 'TEXT LE=10 TE=44 LB='text5' '
  115.     Gadget.6  = 'TEXT LE=10 TE=54 LB='text6' '
  116.     Gadget.7= 'END'
  117.     NewComplexRequest  '"Instructions For Effect #20"' Gadget 386 66
  118. return
  119.  
  120.  
  121. GetFile:
  122.     parse Arg Title, Path
  123.     Address FLY_1 SetString Path
  124.     Address FLY_1 GetFileNameNT Title
  125. return result
  126.  
  127. GetFileName: procedure  
  128.    ARG CompleteName
  129.    c = lastpos("/",CompleteName)
  130.    if c = 0 then c = lastpos(":",CompleteName)
  131.    return substr(CompleteName, c + 1)
  132.  
  133.  
  134. GetA:
  135.  if IAType = 0 then do
  136.     call Switcher(TOSW)
  137.     PicAName = GetFile("Select Flyer Clip For ImageA!  ",DriveName)
  138.     Name = GetFileName(PicAName)
  139.     if Name = "" then do
  140.         Address FLY_1 OK_TEXT " OK "
  141.         Title = "You Must Enter A Valid Clip Name To Use!"
  142.         Address FLY_1 FYINT Title
  143.         Address FLY_1 Quit
  144.         call Switcher(TOWB)
  145.         exit
  146.         end
  147.     Address FLY_1 SetFileName PicAName
  148.     Address FLY_1 GetClipLength PicAName
  149.     End = result
  150.     Start = 0
  151.     Address FLY_1 Program "5"
  152.     Address FLY_1 StartNum Start
  153.     Address FLY_1 EndNum End
  154.     Address FLY_1 CurrentNum "0"
  155.     Address FLY_1 GetTimeNT "Select A Range Of Frames To Process!"
  156.     Start = word(result,1)*2
  157.     End = word(result,2)*2
  158.     Start  = Start + 1
  159.     End = End +2
  160.     call addlib('PROJECT_REXX_PORT' , 0)
  161.     call addlib(TOASTERLIB,0)
  162.     call Switcher(TOWB)
  163.     address command "C:Wait 1"
  164.     ScreenToFront
  165.     end
  166.    if IAType = 1 then do
  167.     RequestFile '"Select Flyer Still For ImageA!"' DriveName ' '
  168.     PicAName = result
  169.     Name = GetFileName(PicAName)
  170.     if Name = "" then do
  171.         Title = "You Must Enter A Valid Name To Use!"
  172.         RequestNotify Title
  173.         if FlyOn = 1 then Address FLY_1 Quit
  174.         exit
  175.         end
  176.     RequestNumber '"Enter Number Of Frames To Process!"' Frames
  177.     End = result
  178.     Start = 1
  179.     end
  180.    if IAType = 2 then do
  181.     RequestFile '"Select FileName For ImageA!"' 'SYS:' ' '
  182.     PicAName = result
  183.     Name = GetFileName(PicAName)
  184.     if Name = "" then do
  185.         Title = "You Must Enter A Valid Name To Use!"
  186.         RequestNotify Title
  187.         if FlyOn = 1 then Address FLY_1 Quit
  188.         exit
  189.         end
  190.     RequestNumber '"Enter Number Of Frames To Process!"' Frames
  191.     End = result
  192.     Start = 1
  193.     end
  194.    if IAType = 3 then do
  195.     RequestFile '"Select BaseName For ImageA! "' 'SYS:' ' '
  196.     PicAName = result
  197.     Name = GetFileName(PicAName)
  198.     if Name = "" then do
  199.         Title = "You Must Enter A Valid Name To Use!"
  200.         RequestNotify Title
  201.         if FlyOn = 1 then Address FLY_1 Quit
  202.         exit
  203.         end
  204.     RequestNumber '"Enter Number Of Frames To Process!"' Frames
  205.     End = result
  206.     Start = 1
  207.     end
  208. return
  209.  
  210. CloseStuff:
  211.     Address FLY_1 Quit
  212.     call remlib('ToasterARexx.port')
  213.     call remlib('PROJECT_REXX_PORT')
  214. return
  215.  
  216.  
  217. OpenFlyStuff:
  218.     FlyOn = 1
  219.     address command "run VFXIFX:FLY" 
  220.     do while (POS('FLY_1',SHOW('Ports')) = 0)
  221.         address command "wait 1"
  222.         end
  223.     TOASTERLIB="ToasterARexx.port"
  224.     call remlib('ToasterARexx.port')
  225.     call remlib('PROJECT_REXX_PORT')
  226.     call addlib('PROJECT_REXX_PORT' , 0)
  227.     call addlib(TOASTERLIB,0)
  228.     DriveName = FindDrive()
  229. return
  230.  
  231.  
  232. FindDrive:
  233.     address command "C:Info >RAM:DriveList"
  234.     call open TempFile,"RAM:DriveList",R
  235.     do until eof(TempFile)
  236.         line = readln(TempFile)
  237.         parse var line Drive" "Rest
  238.         if Drive = "FA0:" then 
  239.             FlyVolume = word(Rest,7)":"
  240.     end
  241.     call close TempFile
  242.     address command "Delete >NIL: RAM:DriveList"
  243. return FlyVolume
  244.  
  245.