home *** CD-ROM | disk | FTP | other *** search
/ Visual FX for Image FX / VisualFX for Image FX 3.adf / Files / SetUp / 03 / 06.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  1997-05-13  |  6.6 KB  |  305 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 To Use!'
  60.     Gadget.2 = 'Grey Scale'
  61.     Gadget.3 = 'Emboss'
  62.     Gadget.4 = 'Antique'
  63.     Gadget.5 = 'Solarize'
  64.     Gadget.6 = 'Negative'
  65.     Gadget.7 = 'Posterize'
  66.     Gadget.8 = 'False Color'
  67.     Gadget.9 = 'Lighten'
  68.     Gadget.10 = 'Darken'
  69.     Gadget.11 = 'SobelEdge'
  70.     ListRequest 11 Gadget
  71.     Type2 = 0
  72.     if result = 2 then Type2 = 0
  73.     if result = 3 then Type2 = 1
  74.     if result = 4 then Type2 = 2
  75.     if result = 5 then Type2 = 3
  76.     if result = 6 then Type2 = 4
  77.     if result = 7 then Type2 = 5
  78.     if result = 8 then Type2 = 6
  79.     if result = 9 then Type2 = 7
  80.     if result = 10 then Type2 = 8
  81.     if result = 11 then Type2 = 9
  82.  
  83.     NumA = 0
  84.     NumB = 100
  85.     NumC = 50
  86.     RequestSlider '"Enter Amount To Feather Edges!"' NumA NumB NumC
  87.     Feather = Result
  88.  
  89.     Gadget.1 = 'Select Picture Options!'
  90.     Gadget.2 = 'Use Standard Size'
  91.     Gadget.3 = 'User Defined Size'
  92.     ListRequest 3 Gadget
  93.     WindowType = -1
  94.     if result = 2 then WindowType = -1
  95.     if result = 3 then do
  96.         i = Start
  97.         call LoadA()
  98.         call PickCircle()
  99.         end
  100.  
  101.  
  102. call open TempFile,"VFXIFX:TempDrawer/"strip(Num),W
  103. call writeln TempFile,PicAName
  104. call writeln TempFile,Start
  105. call writeln TempFile,End
  106. call writeln TempFile,IAType
  107. call writeln TempFile,Type2
  108. call writeln TempFile,Feather
  109. call writeln TempFile,WindowType
  110. call close TempFile
  111. exit
  112.  
  113.  
  114.  
  115. Docs:
  116.  
  117.     text1 = '"This effect takes an image and applies an operator"'
  118.     text2 = '"around the edges of an oval shape. The shape can"'
  119.     text3 = '"be user defined with Feathered edges. The larger"'
  120.     text4 = '"the number for the Feather the longer it takes to"'
  121.     text5 = '"render, but the results are worth it. "'
  122.  
  123.     Gadget.1  = 'TEXT LE=10 TE=4 LB='text1' '
  124.     Gadget.2  = 'TEXT LE=10 TE=14 LB='text2' '
  125.     Gadget.3  = 'TEXT LE=10 TE=24 LB='text3' '
  126.     Gadget.4  = 'TEXT LE=10 TE=34 LB='text4' '
  127.     Gadget.5  = 'TEXT LE=10 TE=44 LB='text5' '
  128.     Gadget.6 = 'END'
  129.     NewComplexRequest  '"Instructions For Effect #06"' Gadget 370 56
  130.  
  131. return
  132.  
  133.  
  134.  
  135.  
  136. PickCircle:
  137.     KillBrush
  138.     Menu ToolBox
  139.     RequestNotify "Draw Circle Where Image Will Show Through!"
  140.     DrawTool Oval
  141.     HidePanel
  142.     Undo On
  143.     WaitFor SELECTDOWN
  144.     parse var result X1 Y1
  145.     WaitFor SELECTUP
  146.     parse var result X2 Y2
  147.     Undo
  148.     ShowPanel
  149.     Undo Off
  150.     X1 = strip(X1)
  151.     Y1 = strip(Y1)
  152.     X2 = strip(X2)-X1
  153.     Y2 = strip(Y2)-Y1
  154.     RequestResponse "Is The Circle You Selected Correct?"
  155.     if rc ~= 0 then call PickCircle()
  156.  
  157.     WindowType = X1" "Y1" "X2" "Y2
  158.  
  159. return
  160.  
  161.  
  162. GetFile:
  163.     parse Arg Title, Path
  164.     Address FLY_1 SetString Path
  165.     Address FLY_1 GetFileNameNT Title
  166. return result
  167.  
  168. GetFileName: procedure  
  169.    ARG CompleteName
  170.    c = lastpos("/",CompleteName)
  171.    if c = 0 then c = lastpos(":",CompleteName)
  172.    return substr(CompleteName, c + 1)
  173.  
  174.  
  175. GetA:
  176.  if IAType = 0 then do
  177.     call Switcher(TOSW)
  178.     PicAName = GetFile("Select Flyer Clip For ImageA!  ",DriveName)
  179.     Name = GetFileName(PicAName)
  180.     if Name = "" then do
  181.         Address FLY_1 OK_TEXT " OK "
  182.         Title = "You Must Enter A Valid Clip Name To Use!"
  183.         Address FLY_1 FYINT Title
  184.         Address FLY_1 Quit
  185.         call Switcher(TOWB)
  186.         exit
  187.         end
  188.     Address FLY_1 SetFileName PicAName
  189.     Address FLY_1 GetClipLength PicAName
  190.     End = result
  191.     Start = 0
  192.     Address FLY_1 Program "5"
  193.     Address FLY_1 StartNum Start
  194.     Address FLY_1 EndNum End
  195.     Address FLY_1 CurrentNum "0"
  196.     Address FLY_1 GetTimeNT "Select A Range Of Frames To Process!"
  197.     Start = word(result,1)*2
  198.     End = word(result,2)*2
  199.     Start  = Start + 1
  200.     End = End +2
  201.     call addlib('PROJECT_REXX_PORT' , 0)
  202.     call addlib(TOASTERLIB,0)
  203.     call Switcher(TOWB)
  204.     address command "C:Wait 1"
  205.     ScreenToFront
  206.     end
  207.    if IAType = 1 then do
  208.     RequestFile '"Select Flyer Still For ImageA!"' DriveName ' '
  209.     PicAName = result
  210.     Name = GetFileName(PicAName)
  211.     if Name = "" then do
  212.         Title = "You Must Enter A Valid Name To Use!"
  213.         RequestNotify Title
  214.         if FlyOn = 1 then Address FLY_1 Quit
  215.         exit
  216.         end
  217.     RequestNumber '"Enter Number Of Frames To Process!"' Frames
  218.     End = result
  219.     Start = 1
  220.     end
  221.    if IAType = 2 then do
  222.     RequestFile '"Select FileName For ImageA!"' 'SYS:' ' '
  223.     PicAName = result
  224.     Name = GetFileName(PicAName)
  225.     if Name = "" then do
  226.         Title = "You Must Enter A Valid Name To Use!"
  227.         RequestNotify Title
  228.         if FlyOn = 1 then Address FLY_1 Quit
  229.         exit
  230.         end
  231.     RequestNumber '"Enter Number Of Frames To Process!"' Frames
  232.     End = result
  233.     Start = 1
  234.     end
  235.    if IAType = 3 then do
  236.     RequestFile '"Select BaseName For ImageA! "' 'SYS:' ' '
  237.     PicAName = result
  238.     Name = GetFileName(PicAName)
  239.     if Name = "" then do
  240.         Title = "You Must Enter A Valid Name To Use!"
  241.         RequestNotify Title
  242.         if FlyOn = 1 then Address FLY_1 Quit
  243.         exit
  244.         end
  245.     RequestNumber '"Enter Number Of Frames To Process!"' Frames
  246.     End = result
  247.     Start = 1
  248.     end
  249. return
  250.  
  251. CloseStuff:
  252.     Address FLY_1 Quit
  253.     call remlib('ToasterARexx.port')
  254.     call remlib('PROJECT_REXX_PORT')
  255. return
  256.  
  257.  
  258. OpenFlyStuff:
  259.     FlyOn = 1
  260.     address command "run VFXIFX:FLY" 
  261.     do while (POS('FLY_1',SHOW('Ports')) = 0)
  262.         address command "wait 1"
  263.         end
  264.     TOASTERLIB="ToasterARexx.port"
  265.     call remlib('ToasterARexx.port')
  266.     call remlib('PROJECT_REXX_PORT')
  267.     call addlib('PROJECT_REXX_PORT' , 0)
  268.     call addlib(TOASTERLIB,0)
  269.     DriveName = FindDrive()
  270. return
  271.  
  272.  
  273. FindDrive:
  274.     address command "C:Info >RAM:DriveList"
  275.     call open TempFile,"RAM:DriveList",R
  276.     do until eof(TempFile)
  277.         line = readln(TempFile)
  278.         parse var line Drive" "Rest
  279.         if Drive = "FA0:" then 
  280.             FlyVolume = word(Rest,7)":"
  281.     end
  282.     call close TempFile
  283.     address command "Delete >NIL: RAM:DriveList"
  284. return FlyVolume
  285.  
  286.  
  287.  
  288. LoadA:
  289.     if IAType = 0 then do
  290.         LoadBuffer PicAName Force Start
  291.         end
  292.     if IAType = 1 then do
  293.         LoadBuffer PicAName Force 1
  294.         end
  295.     if IAType = 2 then do
  296.         LoadBuffer PicAName Force
  297.         end
  298.     if IAType = 3 then do
  299.         LoadBuffer PicAName""right(Start,3,'0') Force
  300.         end
  301. return
  302.  
  303.  
  304.  
  305.