home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD1.iso / GFX / ADPro251-3.DMS / ADPro251-3.adf / FREDScripts.lha / FREDOperators / GradualCollapse.fred.pre < prev    next >
Encoding:
Text File  |  1994-01-31  |  4.3 KB  |  146 lines

  1. /*
  2. ** GradualCollapse.fred.pre
  3. **
  4. ** $VER: GradualCollapse.fred.pre 1.1.0 (23.10.93)
  5. **
  6. ** If the GradualCollapse.fred script appears in the InvokeADPro list,
  7. ** this program will ask the user to enter the starting and ending values
  8. ** for the collapse.
  9. **
  10. ** Clips Exported:
  11. **    FREDGradualCollapseAmtCurr        -    Current collapse amount
  12. **    FREDGradualCollapseBlurCurr        -    Current blur radius
  13. **    FREDGradualCollapseCenterXCurr        -    Current x position
  14. **    FREDGradualCollapseCenterYCurr        -    Current y position
  15. **    FREDGradualCollapseRadCurr        -    Current radius
  16. **    FREDGradualCollapseAmtIncr        -    Collapse amount increment
  17. **    FREDGradualCollapseBlurIncr        -    Blur radius increment
  18. **    FREDGradualCollapseCenterXIncr        -    X position increment
  19. **    FREDGradualCollapseCenterYIncr        -    Y position increment
  20. **    FREDGradualCollapseRadIncr        -    Radius increment
  21. **    FREDGradualCollapseAmtFinal        -    Final collapse amount
  22. **    FREDGradualCollapseBlurFinal        -    Final blur radius
  23. **    FREDGradualCollapseCenterXFinal        -    Final x position
  24. **    FREDGradualCollapseCenterYFinal        -    Final y position
  25. **    FREDGradualCollapseRadFinal        -    Final radius
  26. **    FREDGradualCollapseNumberOfFrames    -    The number of frames selected
  27. **    FREDGradualCollapseFrameCount        -    The number of frames already processed
  28. **
  29. ** NOTE: Clip names are case sensitive.
  30. **
  31. ** This script requires FRED v1.4.0 (or higher) to run.  Also required is
  32. ** ADPro v2.5.0 (or higher).
  33. **
  34. ** Copyright © 1993 ASDG, Incorporated
  35. ** All Rights Reserved
  36. */
  37.  
  38.  
  39. ADDRESS "ADPro"
  40. OPTIONS RESULTS
  41.  
  42. PARSE ARG NumberOfCells NumberOfFrames
  43.  
  44. NL = '0A'X
  45. SQ = '27'X
  46. DQ = '22'X
  47. TRUE  = 1
  48. FALSE = 0
  49.  
  50.  
  51. /*
  52. ** Ensure that at least two frames are to be processed.
  53. */
  54.  
  55. IF (NumberOfFrames < 2) THEN DO
  56.     ADPRO_TO_FRONT
  57.     OKAY1 "Frame count must be more than 2."
  58.     SCREEN_TO_FRONT "FRED"
  59.     EXIT 10
  60. END
  61.  
  62.  
  63. /*
  64. ** Ask the user for the initial parameters.
  65. */
  66.  
  67. CALL "FREDSCRIPTS:FREDFunctions/GetANumber" '"Starting collapse amount"' 0 0 100 TRUE
  68. IF (RESULT = (0-1)) THEN
  69.     EXIT 10
  70. CurrAmt = RESULT
  71.  
  72. CALL "FREDSCRIPTS:FREDFunctions/GetANumber" '"Starting blur radius"' 0 0 99 TRUE
  73. IF (RESULT = (0-1)) THEN
  74.     EXIT 10
  75. CurrBlur = RESULT
  76.  
  77. CALL "FREDSCRIPTS:FREDFunctions/GetANumber" '"Starting X position"' 0 (-30000) 30000 TRUE
  78. IF (RESULT = ((-30000)-1)) THEN
  79.     EXIT 10
  80. CurrCenterX = RESULT
  81.  
  82. CALL "FREDSCRIPTS:FREDFunctions/GetANumber" '"Starting Y position"' 0 (-30000) 30000 TRUE
  83. IF (RESULT = ((-30000)-1)) THEN
  84.     EXIT 10
  85. CurrCenterY = RESULT
  86.  
  87. CALL "FREDSCRIPTS:FREDFunctions/GetANumber" '"Starting radius"' 50 5 15000 TRUE
  88. IF (RESULT = (5-1)) THEN
  89.     EXIT 10
  90. CurrRad = RESULT
  91.  
  92.  
  93. /*
  94. ** Ask the user for the final parameters.
  95. */
  96.  
  97. CALL "FREDSCRIPTS:FREDFunctions/GetANumber" '"Ending collapse amount"' 0 0 100 TRUE
  98. IF (RESULT = (0-1)) THEN
  99.     EXIT 10
  100. FinalAmt = RESULT
  101.  
  102. CALL "FREDSCRIPTS:FREDFunctions/GetANumber" '"Ending blur radius"' 0 0 99 TRUE
  103. IF (RESULT = (0-1)) THEN
  104.     EXIT 10
  105. FinalBlur = RESULT
  106.  
  107. CALL "FREDSCRIPTS:FREDFunctions/GetANumber" '"Ending X position"' 0 (-30000) 30000 TRUE
  108. IF (RESULT = ((-30000)-1)) THEN
  109.     EXIT 10
  110. FinalCenterX = RESULT
  111.  
  112. CALL "FREDSCRIPTS:FREDFunctions/GetANumber" '"Ending Y position"' 0 (-30000) 30000 TRUE
  113. IF (RESULT = ((-30000)-1)) THEN
  114.     EXIT 10
  115. FinalCenterY = RESULT
  116.  
  117. CALL "FREDSCRIPTS:FREDFunctions/GetANumber" '"Ending radius"' 50 5 15000 TRUE
  118. IF (RESULT = (5-1)) THEN
  119.     EXIT 10
  120. FinalRad = RESULT
  121.  
  122.  
  123. /*
  124. ** Update the clips.
  125. */
  126.  
  127. SETCLIP( "FREDGradualCollapseAmtCurr", CurrAmt )
  128. SETCLIP( "FREDGradualCollapseBlurCurr", CurrBlur )
  129. SETCLIP( "FREDGradualCollapseCenterXCurr", CurrCenterX )
  130. SETCLIP( "FREDGradualCollapseCenterYCurr", CurrCenterY )
  131. SETCLIP( "FREDGradualCollapseRadCurr", CurrRad )
  132. SETCLIP( "FREDGradualCollapseAmtIncr", (FinalAmt - CurrAmt) / (NumberOfFrames - 1) )
  133. SETCLIP( "FREDGradualCollapseBlurIncr", (FinalBlur - CurrBlur) / (NumberOfFrames - 1) )
  134. SETCLIP( "FREDGradualCollapseCenterXIncr", (FinalCenterX - CurrCenterX) / (NumberOfFrames - 1) )
  135. SETCLIP( "FREDGradualCollapseCenterYIncr", (FinalCenterY - CurrCenterY) / (NumberOfFrames - 1) )
  136. SETCLIP( "FREDGradualCollapseRadIncr", (FinalRad - CurrRad) / (NumberOfFrames - 1) )
  137. SETCLIP( "FREDGradualCollapseAmtFinal", FinalAmt )
  138. SETCLIP( "FREDGradualCollapseBlurFinal", FinalBlur )
  139. SETCLIP( "FREDGradualCollapseCenterXFinal", FinalCenterX )
  140. SETCLIP( "FREDGradualCollapseCenterYFinal", FinalCenterY )
  141. SETCLIP( "FREDGradualCollapseRadFinal", FinalRad )
  142. SETCLIP( "FREDGradualCollapseNumberOfFrames", NumberOfFrames )
  143. SETCLIP( "FREDGradualCollapseFrameCount", 0 )
  144.  
  145. EXIT 0
  146.