home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 20 / AACD20.BIN / AACD / Graphics / PerfectPaint / rexx / bridge / MkAnim.rx < prev    next >
Text File  |  2000-04-09  |  1KB  |  82 lines

  1. /*     arexx Script 
  2.     Load anim
  3. */
  4.  
  5.     options results
  6.     parse ARG Port b
  7.     
  8.     ADDRESS value Port
  9.     pp_AvoidRefresh
  10.  
  11.     Preview=0
  12.     pp_DialogInit 250 60 "*Preview*Size*" 1
  13.         pp_Cycle 0 100 8 100 16 "Size" 1 "96x96|144x144|192x192" Preview
  14.     pp_Dialog
  15.     rc=result
  16.     if rc=0 then
  17.         do
  18.             EXIT
  19.         end        
  20.  
  21.     pp_GetDialog 0
  22.     Preview=result
  23.  
  24.     pp_AskFile 'Load*Anim'
  25.     file=result
  26.  
  27.     pp_Asay 'Split*Animation|Please*wait*...'
  28.     address COMMAND
  29.     'PerfectPaint:Tools/BuildAnim '||file||' PerfectPaint:Temp/Anim SPLIT'
  30.  
  31.     name="ram:script"
  32.     path='perfectpaint:Temp'
  33.     
  34.     ADDRESS COMMAND 'List >'||name||' '||path||' NOHEAD LFORMAT="%s"'
  35.     ADDRESS COMMAND 'Sort 'name' 'name'.s'
  36.  
  37.     count=0
  38.     IF OPEN('listfile',name'.s') THEN DO
  39.     DO FOREVER
  40.         fline = READLN('listfile')
  41.         IF EOF('listfile') THEN BREAK
  42.         count=count+1
  43.         nom.count='PerfectPaint:Temp/'||fline
  44.     END
  45.     CALL CLOSE('listfile')
  46.     END
  47.     
  48.     ADDRESS value Port
  49.     pp_CloseAsay
  50.  
  51.     IF count>0 then DO
  52.         file=nom.1
  53.         pp_Load file
  54.         pp_MakeAnim count Preview
  55.         pp_CountFrames
  56.         count=result
  57.         Do i=2 to count
  58.             pp_FastNextFrame
  59.             file=nom.i
  60.             pp_Bload file
  61.             pp_GetWidthB
  62.             w=result
  63.             IF w=0 then DO
  64.                 EXIT
  65.             END
  66.             pp_GetHeightB
  67.             h=result
  68.             x=w/2
  69.             y=h/2
  70.             pp_Plot x y
  71.         END
  72.         pp_GotoFrame 1
  73.     END
  74.     pp_FreeBrush
  75.     pp_PermitRefresh
  76.  
  77.     ADDRESS COMMAND    'delete >nil: PerfectPaint:Temp/?#.*'
  78.  
  79.     
  80.  
  81.  
  82.