/* ** GradualSphere.fred.pre ** ** $VER: GradualSphere.fred.pre 1.2.0 (18.11.93) ** ** If the GradualSphere.fred scripts appears in the InvokeADPro list, ** this program will ask the user to enter the starting and ending ** distortion amounts. ** ** Clips Exported: ** FREDSphereDistortionCurr - Current amount of distortion ** FREDSphereDistortionIncr - Amount of distortion increment ** FREDSphereDistortionFinal - Final amount of distortion ** FREDSphereCirclenessCurr - Current circleness factor ** FREDSphereCirclenessIncr - Circleness increment ** FREDSphereCirclenessFinal - Final circleness amount ** FREDNumFrames - Number of selected frames ** FREDCurrFrameNum - Current frame number ** ** 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) or MorphPlus v1.3.0 (or higher). ** ** Copyright © 1992-1993 Elastic Reality, Inc. ** 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 to enter the starting and ending amounts of distortion. */ CALL "FREDSCRIPTS:FREDFunctions/GetANumber" '"Starting Distortion"' 90 1 100 TRUE SphereDistortionCurr = RESULT IF (SphereDistortionCurr = (1-1)) THEN EXIT 10 CALL "FREDSCRIPTS:FREDFunctions/GetANumber" '"Ending Distortion"' SphereDistortionCurr 1 100 TRUE SphereDistortionFinal = RESULT IF (SphereDistortionFinal = (1-1)) THEN EXIT 10 IF (SphereDistortionCurr < SphereDistortionFinal) THEN DO SphereCirclenessCurr = 0.0 SphereCirclenessIncr = 100.0 / (NumberOfFrames - 1) SphereCirclenessFinal = 100.0 END ELSE DO SphereCirclenessCurr = 100.0 SphereCirclenessIncr = (-100.0) / (NumberOfFrames - 1) SphereCirclenessFinal = 0.0 END /* ** Update the clips. */ SETCLIP( "FREDSphereDistortionCurr", SphereDistortionCurr ) SETCLIP( "FREDSphereDistortionIncr", TRUNC( (SphereDistortionFinal - SphereDistortionCurr) / (NumberOfFrames - 1) ) ) SETCLIP( "FREDSphereDistortionFinal", SphereDistortionFinal ) SETCLIP( "FREDSphereCirclenessCurr", SphereCirclenessCurr ) SETCLIP( "FREDSphereCirclenessIncr", SphereCirclenessIncr ) SETCLIP( "FREDSphereCirclenessFinal", SphereCirclenessFinal ) SETCLIP( "FREDNumFrames", NumberOfFrames ) SETCLIP( "FREDCurrFrameNum", 1 ) EXIT 0