/* ** SaveAsANIM.fred ** ** $VER: SaveAsANIM.fred 1.2.0 (24.10.93) ** ** This program can be run from an InvokeADPro list to save images to ** an ANIM file. Including this program automatically causes a pre and ** post program to be executed as well (to select the anim file and to ** wrap it up after processing). ** ** Clips Imported: ** FREDANIMName - ANIM file user picked ** FREDOverrideLength - Override Length parameter flag ** (if 1, override the Length) ** FREDANIMCompressMode - Compression mode ** FREDANIMCompressQuality - Compression quality ** ** 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 © 1992-1993 Elastic Reality, Inc. ** All Rights Reserved */ ADDRESS "ADPro" OPTIONS RESULTS PARSE ARG FrameNum FrameFName Length LoadFlag FirstCallSeq FirstCallCell NL = '0A'X SQ = '27'X DQ = '22'X TRUE = 1 FALSE = 0 /* ** Get the required clips. Error if any are missing. */ ANIMName = GETCLIP( "FREDANIMName" ) IF (ANIMName = "") THEN DO ADPRO_TO_FRONT OKAY1 "Required clip, FREDANIMName," || NL ||, "is not specified." SCREEN_TO_FRONT "FRED" EXIT 10 END ANIMCompressType = GETCLIP( "FREDANIMCompressMode" ) IF (ANIMCompressType = "") THEN DO ADPRO_TO_FRONT OKAY1 "Required clip, FREDANIMCompressMode," || NL ||, "is not specified." SCREEN_TO_FRONT "FRED" EXIT 10 END ANIMCompressQual = GETCLIP( "FREDANIMCompressQuality" ) IF (ANIMCompressQual = "") THEN DO ADPRO_TO_FRONT OKAY1 "Required clip, FREDANIMCompressQuality," || NL ||, "is not specified." SCREEN_TO_FRONT "FRED" EXIT 10 END OverrideLength = GETCLIP( "FREDOverrideLength" ) IF (OverrideLength = 1) THEN Length = 1 /* ** See what type of data is loaded in ADPro/MorphPlus. */ CALL "FREDSCRIPTS:FREDFunctions/CheckForRenderedImageData" TRUE IF (RESULT ~= 0) THEN EXIT 10 /* ** Do the save. */ DO LoopCounter=1 TO Length SAVER "ANIM" ANIMName "IMAGE" "APPEND" ANIMCompressType ANIMCompressQual Why = ADPRO_RESULT IF (RC ~= 0) THEN DO ADPRO_TO_FRONT OKAY1 "ANIM save failed:" || NL || Why || NL ||, "Argument Information:" || NL ||, "Filename = " || ANIMName || NL ||, "ImageType = " || "IMAGE" || NL ||, "Flags = " || "APPEND" SAVE ANIMName "IMAGE" "QUIT" IF (RC ~= 0) THEN DO ADPRO_TO_FRONT OKAY1 "Closing the ANIM file failed." || NL ||, "You will need to close the file" || NL ||, "manually with the control panel." END SCREEN_TO_FRONT "FRED" EXIT 10 END END EXIT 0