home *** CD-ROM | disk | FTP | other *** search
- /*
- ** GradualCollapse.fred.pre
- **
- ** $VER: GradualCollapse.fred.pre 1.1.0 (23.10.93)
- **
- ** If the GradualCollapse.fred script appears in the InvokeADPro list,
- ** this program will ask the user to enter the starting and ending values
- ** for the collapse.
- **
- ** Clips Exported:
- ** FREDGradualCollapseAmtCurr - Current collapse amount
- ** FREDGradualCollapseBlurCurr - Current blur radius
- ** FREDGradualCollapseCenterXCurr - Current x position
- ** FREDGradualCollapseCenterYCurr - Current y position
- ** FREDGradualCollapseRadCurr - Current radius
- ** FREDGradualCollapseAmtIncr - Collapse amount increment
- ** FREDGradualCollapseBlurIncr - Blur radius increment
- ** FREDGradualCollapseCenterXIncr - X position increment
- ** FREDGradualCollapseCenterYIncr - Y position increment
- ** FREDGradualCollapseRadIncr - Radius increment
- ** FREDGradualCollapseAmtFinal - Final collapse amount
- ** FREDGradualCollapseBlurFinal - Final blur radius
- ** FREDGradualCollapseCenterXFinal - Final x position
- ** FREDGradualCollapseCenterYFinal - Final y position
- ** FREDGradualCollapseRadFinal - Final radius
- ** FREDGradualCollapseNumberOfFrames - The number of frames selected
- ** FREDGradualCollapseFrameCount - The number of frames already processed
- **
- ** NOTE: Clip names are case sensitive.
- **
- ** This script requires FRED v1.4.0 (or higher) to run. Also required is
- ** ADPro v2.5.0 (or higher).
- **
- ** Copyright © 1993 ASDG, Incorporated
- ** All Rights Reserved
- */
-
-
- ADDRESS "ADPro"
- OPTIONS RESULTS
-
- PARSE ARG NumberOfCells NumberOfFrames
-
- NL = '0A'X
- SQ = '27'X
- DQ = '22'X
- TRUE = 1
- FALSE = 0
-
-
- /*
- ** Ensure that at least two frames are to be processed.
- */
-
- IF (NumberOfFrames < 2) THEN DO
- ADPRO_TO_FRONT
- OKAY1 "Frame count must be more than 2."
- SCREEN_TO_FRONT "FRED"
- EXIT 10
- END
-
-
- /*
- ** Ask the user for the initial parameters.
- */
-
- CALL "FREDSCRIPTS:FREDFunctions/GetANumber" '"Starting collapse amount"' 0 0 100 TRUE
- IF (RESULT = (0-1)) THEN
- EXIT 10
- CurrAmt = RESULT
-
- CALL "FREDSCRIPTS:FREDFunctions/GetANumber" '"Starting blur radius"' 0 0 99 TRUE
- IF (RESULT = (0-1)) THEN
- EXIT 10
- CurrBlur = RESULT
-
- CALL "FREDSCRIPTS:FREDFunctions/GetANumber" '"Starting X position"' 0 (-30000) 30000 TRUE
- IF (RESULT = ((-30000)-1)) THEN
- EXIT 10
- CurrCenterX = RESULT
-
- CALL "FREDSCRIPTS:FREDFunctions/GetANumber" '"Starting Y position"' 0 (-30000) 30000 TRUE
- IF (RESULT = ((-30000)-1)) THEN
- EXIT 10
- CurrCenterY = RESULT
-
- CALL "FREDSCRIPTS:FREDFunctions/GetANumber" '"Starting radius"' 50 5 15000 TRUE
- IF (RESULT = (5-1)) THEN
- EXIT 10
- CurrRad = RESULT
-
-
- /*
- ** Ask the user for the final parameters.
- */
-
- CALL "FREDSCRIPTS:FREDFunctions/GetANumber" '"Ending collapse amount"' 0 0 100 TRUE
- IF (RESULT = (0-1)) THEN
- EXIT 10
- FinalAmt = RESULT
-
- CALL "FREDSCRIPTS:FREDFunctions/GetANumber" '"Ending blur radius"' 0 0 99 TRUE
- IF (RESULT = (0-1)) THEN
- EXIT 10
- FinalBlur = RESULT
-
- CALL "FREDSCRIPTS:FREDFunctions/GetANumber" '"Ending X position"' 0 (-30000) 30000 TRUE
- IF (RESULT = ((-30000)-1)) THEN
- EXIT 10
- FinalCenterX = RESULT
-
- CALL "FREDSCRIPTS:FREDFunctions/GetANumber" '"Ending Y position"' 0 (-30000) 30000 TRUE
- IF (RESULT = ((-30000)-1)) THEN
- EXIT 10
- FinalCenterY = RESULT
-
- CALL "FREDSCRIPTS:FREDFunctions/GetANumber" '"Ending radius"' 50 5 15000 TRUE
- IF (RESULT = (5-1)) THEN
- EXIT 10
- FinalRad = RESULT
-
-
- /*
- ** Update the clips.
- */
-
- SETCLIP( "FREDGradualCollapseAmtCurr", CurrAmt )
- SETCLIP( "FREDGradualCollapseBlurCurr", CurrBlur )
- SETCLIP( "FREDGradualCollapseCenterXCurr", CurrCenterX )
- SETCLIP( "FREDGradualCollapseCenterYCurr", CurrCenterY )
- SETCLIP( "FREDGradualCollapseRadCurr", CurrRad )
- SETCLIP( "FREDGradualCollapseAmtIncr", (FinalAmt - CurrAmt) / (NumberOfFrames - 1) )
- SETCLIP( "FREDGradualCollapseBlurIncr", (FinalBlur - CurrBlur) / (NumberOfFrames - 1) )
- SETCLIP( "FREDGradualCollapseCenterXIncr", (FinalCenterX - CurrCenterX) / (NumberOfFrames - 1) )
- SETCLIP( "FREDGradualCollapseCenterYIncr", (FinalCenterY - CurrCenterY) / (NumberOfFrames - 1) )
- SETCLIP( "FREDGradualCollapseRadIncr", (FinalRad - CurrRad) / (NumberOfFrames - 1) )
- SETCLIP( "FREDGradualCollapseAmtFinal", FinalAmt )
- SETCLIP( "FREDGradualCollapseBlurFinal", FinalBlur )
- SETCLIP( "FREDGradualCollapseCenterXFinal", FinalCenterX )
- SETCLIP( "FREDGradualCollapseCenterYFinal", FinalCenterY )
- SETCLIP( "FREDGradualCollapseRadFinal", FinalRad )
- SETCLIP( "FREDGradualCollapseNumberOfFrames", NumberOfFrames )
- SETCLIP( "FREDGradualCollapseFrameCount", 0 )
-
- EXIT 0
-