home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 13 / AACD13.ISO / AACD / Graphics / TimeMachine / timemachine / rexx / render.ifx < prev    next >
Text File  |  2000-08-07  |  5KB  |  244 lines

  1. /**********************
  2.  
  3.  
  4. **********************/
  5.  
  6. options results
  7.  
  8. Gadget.1  = 'CYCLE  13 5  200 15 "" 0 Sequence/JStream/FlyerClip/ANIM'
  9. Gadget.2  = 'END'
  10.  
  11. NewComplexRequest '"Save Format"' Gadget 226 30
  12. IF rc ~= 0 THEN EXIT
  13.  
  14. savetype=result.1
  15.  
  16.  
  17. if savetype=0 then
  18.     do
  19.     
  20.     SGadget.1  = 'CYCLE  13 5  200 15 "" 0 ILBM/JPEG_85/JPEG_50'
  21.     SGadget.2  = 'END'
  22.  
  23.     NewComplexRequest '"File Format"' SGadget 226 30
  24.     IF rc ~= 0 THEN EXIT
  25.  
  26.     seqfileformat=result.1
  27.  
  28.  
  29.     RequestFile '"Basename"' '""' '""' '"#?"' 
  30.     if rc ~=0 then exit
  31.     seqfile=Result
  32.     end
  33.  
  34. if savetype=1 then
  35.     do
  36.     RequestFile '"JStream"' '""' '""' '"#?"' 
  37.     if rc ~=0 then exit
  38.     JSfile=Result
  39.     end
  40.  
  41. if savetype=2 then
  42.     do
  43.     RequestFile '"FlyerClip"' '""' '""' '"#?"' 
  44.     if rc ~=0 then exit
  45.     FCfile=Result
  46.     end
  47.  
  48. if savetype=3 then
  49.     do
  50.     AGadget.1  = 'CYCLE  5 5  200 15 "" 0 Anim5/Anim7'
  51.     AGadget.2  = 'CHECK 220  5 15 15 "Lock Palette?" 0 '
  52.     AGadget.3 = 'END'
  53.  
  54.  
  55.     NewComplexRequest '"Animation Format"' AGadget 350 30
  56.     IF rc ~=0 THEN EXIT 
  57.     
  58.     AType=result.1
  59.     Alock=result.2
  60.  
  61.     Menu render
  62.     requestresponse 'Animation will use current settings. Proceed?'
  63.     if rc ~=0 then exit
  64.     menu toolbox
  65.  
  66.     RequestFile '"Animation"' '""' '""' '"#?"' 
  67.     Animfile=Result
  68.     end
  69.  
  70. else nop
  71.  
  72. layers=getclip('TM_TotalLayers')
  73.  
  74. frames=getclip('TM_TotalFrames')
  75.  
  76. do i = 1 to frames
  77.  
  78. call setclip('TM_Renderframe',i)
  79.  
  80. bgformat=getclip('TM_Layer0Type')
  81.     
  82.     if bgformat=0 then
  83.     createbuffer getclip('TM_Layer0Width') getclip('TM_Layer0Height') force
  84.     
  85.     else if bgformat=1 then
  86.     loadbuffer getclip('TM_Layer0Filename') force
  87.     
  88.     else if bgformat=2 then
  89.         do
  90.         digits=getclip('TM_Layer0Extension')
  91.         num=RIGHT(i+getclip('TM_Layer0Start')-1,digits,'0')
  92.         loadbuffer getclip('TM_Layer0Filename')||num force
  93.         end
  94.  
  95.     else if bgformat=3 then
  96.         do
  97.         if getclip('TM_Layer0Freezeswitch')=0 then
  98.         loadbufferas JStream getclip('TM_Layer0Filename') i+getclip('TM_Layer0Jstart')-1 both lace  
  99.         else
  100.         loadbufferas JStream getclip('TM_Layer0Filename') getclip('TM_Layer0Jstart') both lace  
  101.         end
  102.     else if bgformat=4 then
  103.         do
  104.         if getclip('TM_Layer0Freezeswitch')=0 then
  105.         loadbuffer getclip('TM_Layer0Filename') i+getclip('TM_Layer0FCstart')-1   
  106.         else
  107.         loadbuffer getclip('TM_Layer0Filename') getclip('TM_Layer0FCstart')   
  108.         end
  109.  
  110.     else if bgformat=5 then
  111.         do
  112.         if getclip('TM_Layer0Freezeswitch')=0 then
  113.         loadbuffer getclip('TM_Layer0Filename') i+getclip('TM_Layer0Astart')-1  
  114.         else
  115.         loadbuffer getclip('TM_Layer0Filename') getclip('TM_Layer0Astart') both lace  
  116.         end    
  117.  
  118.  
  119. if getclip('TM_Layer0Script')='' then nop
  120. else
  121. rx getclip('TM_Layer0Script')
  122.  
  123.  
  124. /****** layers start here ********/
  125. if getclip('TM_TotalLayers')>1 then
  126.     do a=1 to layers-1
  127.     
  128.     format=getclip('TM_Layer'a'Type')
  129.     
  130.     if format=1 then
  131.     loadlayer getclip('TM_Layer'a'Filename') 
  132.     
  133.     else if format=2 then
  134.         do
  135.         digits=getclip('TM_Layer'a'Extension')
  136.         num=RIGHT(i+getclip('TM_Layer'a'Start')-1,digits,'0')
  137.         loadlayer getclip('TM_Layer'a'Filename')||num force
  138.         end
  139.  
  140.     else if format=3 then
  141.         do
  142.         if getclip('TM_Layer'a'Freezeswitch')=0 then
  143.         loadlayer getclip('TM_Layer'a'Filename') i+getclip('TM_Layer'a'Jstart')-1 both lace  
  144.         else
  145.         loadlayer getclip('TM_Layer'a'Filename') getclip('TM_Layer'a'Jstart') both lace    
  146.         end
  147.     else if format=4 then
  148.         do
  149.         if getclip('TM_Layer'a'Freezeswitch')=0 then
  150.         loadlayer getclip('TM_Layer'a'Filename') i+getclip('TM_Layer'a'FCstart')-1   
  151.         else
  152.         loadlayer getclip('TM_Layer'a'Filename') getclip('TM_Layer'a'FCstart')     
  153.         end
  154.  
  155.     else if format=5 then
  156.         do
  157.         if getclip('TM_Layer'a'Freezeswitch')=0 then
  158.         loadlayer getclip('TM_Layer'a'Filename') i+getclip('TM_Layer'a'Astart')-1 
  159.         else
  160.         loadlayer getclip('TM_Layer'a'Filename') getclip('TM_Layer'a'Astart')     
  161.         end    
  162.  
  163.     if getclip('TM_Layer'a'Mode')='' then nop
  164.     else
  165.     layermode getclip('TM_Layer'a'Mode')
  166.  
  167.     if getclip('TM_Layer'a'Blend')='' then nop
  168.     else
  169.     layerblend getclip('TM_Layer'a'Blend')
  170.  
  171.     if getclip('TM_Layer'a'PositionX')='' then nop
  172.     else
  173.     layeroffset getclip('TM_Layer'a'PositionX') getclip('TM_Layer'a'PositionY')
  174.  
  175.     
  176.     if getclip('TM_Layer'a'Script')='' then nop
  177.     else
  178.     rx getclip('TM_Layer'a'Script')
  179.  
  180.     end
  181.  
  182. flattenlayers
  183.  
  184. if getclip('TM_PostScript')='' then nop
  185.     else
  186.     rx getclip('TM_PostScript')
  187.  
  188.  
  189.  
  190. message 'Saving frame 'i
  191.  
  192.  
  193. if savetype = 0 then
  194.     do
  195.     ext = RIGHT(i,4,'0')
  196.     if seqfileformat=0 then
  197.     savebufferas ilbm seqfile||ext
  198.     else if seqfileformat=1 then
  199.     savebufferas jpeg seqfile||ext 85
  200.     else if seqfileformat=2 then
  201.     savebufferas jpeg seqfile||ext 50
  202.     end
  203.  
  204. else if savetype = 1 then
  205.     savebufferas jstream JSFile append
  206.  
  207. else if savetype = 2 then
  208.     savebufferas flyerclip FCFile append
  209.  
  210. else if savetype = 3 then
  211.         do
  212.         if ALock=1 then do
  213.             if i =1 then
  214.             lockrange 0 off
  215.             else
  216.             lockrange 0 on
  217.             end
  218.         else
  219.         lockrange 0 off
  220.         
  221.     render go
  222.  
  223.     if AType=0 then
  224.     saverenderedas ANIM Animfile keep append
  225.     else
  226.     saverenderedas ANIM7 Animfile keep append
  227.  
  228.     render close    
  229.     if i < frames then
  230.     killall
  231.     end
  232. end                        /* end of load_save loop */
  233.  
  234. if savetype=3 then do
  235.     if AType=0 then
  236.     saverenderedas ANIM Animfile close
  237.     else
  238.     saverenderedas ANIM7 Animfile close
  239.     end
  240.  
  241.  
  242.  
  243. exit
  244.