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

  1. /*
  2. ** SaveAsANIM.fred
  3. **
  4. ** $VER: SaveAsANIM.fred 1.2.0 (24.10.93)
  5. **
  6. ** This program can be run from an InvokeADPro list to save images to
  7. ** an ANIM file.  Including this program automatically causes a pre and
  8. ** post program to be executed as well (to select the anim file and to
  9. ** wrap it up after processing).
  10. **
  11. ** Clips Imported:
  12. **    FREDANIMName        -    ANIM file user picked
  13. **    FREDOverrideLength    -    Override Length parameter flag
  14. **                    (if 1, override the Length)
  15. **    FREDANIMCompressMode    -    Compression mode
  16. **    FREDANIMCompressQuality    -    Compression quality
  17. **
  18. ** NOTE: Clip names are case sensitive.
  19. **
  20. ** This script requires FRED v1.4.0 (or higher) to run.  Also required is
  21. ** ADPro v2.5.0 (or higher).
  22. **
  23. ** Copyright © 1992-1993 ASDG, Incorporated
  24. ** All Rights Reserved
  25. */
  26.  
  27.  
  28. ADDRESS "ADPro"
  29. OPTIONS RESULTS
  30.  
  31. PARSE ARG FrameNum FrameFName Length LoadFlag FirstCallSeq FirstCallCell
  32.  
  33. NL = '0A'X
  34. SQ = '27'X
  35. DQ = '22'X
  36. TRUE  = 1
  37. FALSE = 0
  38.  
  39.  
  40. /*
  41. ** Get the required clips.  Error if any are missing.
  42. */
  43.  
  44. ANIMName = GETCLIP( "FREDANIMName" )
  45. IF (ANIMName = "") THEN DO
  46.     ADPRO_TO_FRONT
  47.     OKAY1 "Required clip, FREDANIMName," || NL ||,
  48.         "is not specified."
  49.     SCREEN_TO_FRONT "FRED"
  50.     EXIT 10
  51. END
  52.  
  53. ANIMCompressType = GETCLIP( "FREDANIMCompressMode" )
  54. IF (ANIMCompressType = "") THEN DO
  55.     ADPRO_TO_FRONT
  56.     OKAY1 "Required clip, FREDANIMCompressMode," || NL ||,
  57.         "is not specified."
  58.     SCREEN_TO_FRONT "FRED"
  59.     EXIT 10
  60. END
  61.  
  62. ANIMCompressQual = GETCLIP( "FREDANIMCompressQuality" )
  63. IF (ANIMCompressQual = "") THEN DO
  64.     ADPRO_TO_FRONT
  65.     OKAY1 "Required clip, FREDANIMCompressQuality," || NL ||,
  66.         "is not specified."
  67.     SCREEN_TO_FRONT "FRED"
  68.     EXIT 10
  69. END
  70.  
  71. OverrideLength = GETCLIP( "FREDOverrideLength" )
  72. IF (OverrideLength = 1) THEN
  73.     Length = 1
  74.  
  75.  
  76. /*
  77. ** See what type of data is loaded in ADPro/MorphPlus.
  78. */
  79.  
  80. CALL "FREDSCRIPTS:FREDFunctions/CheckForRenderedImageData" TRUE
  81. IF (RESULT ~= 0) THEN
  82.     EXIT 10
  83.  
  84.  
  85. /*
  86. ** Do the save.
  87. */
  88.  
  89. DO LoopCounter=1 TO Length
  90.     SAVER "ANIM" ANIMName "IMAGE" "APPEND" ANIMCompressType ANIMCompressQual
  91.     Why = ADPRO_RESULT
  92.     IF (RC ~= 0) THEN DO
  93.         ADPRO_TO_FRONT
  94.         OKAY1 "ANIM save failed:" || NL || Why || NL ||,
  95.             "Argument Information:" || NL ||,
  96.             "Filename = " || ANIMName || NL ||,
  97.             "ImageType = " || "IMAGE" || NL ||,
  98.             "Flags = " || "APPEND"
  99.         SAVE ANIMName "IMAGE" "QUIT"
  100.         IF (RC ~= 0) THEN DO
  101.             ADPRO_TO_FRONT
  102.             OKAY1 "Closing the ANIM file failed." || NL ||,
  103.                 "You will need to close the file" || NL ||,
  104.                 "manually with the control panel."
  105.         END
  106.  
  107.         SCREEN_TO_FRONT "FRED"
  108.         EXIT 10
  109.     END
  110. END
  111.  
  112. EXIT 0
  113.