{ This cycles through the flames in the Title Window and sets their time field, and saves them all off to a single flame file. Then it creates a bat file (saved to the same output path) that will launch flam3-animate and render the files (frames). Flam3 will automatically interpolate the flames. by Exper - exper.3drecursions.com v. 1.0 8/29/2006 v. 1.1 3/25/2007 v. 1.2.b1 - b2 3/28/2007 v. 1.2.b3 - b5 3/29/2007 v. 1.2.b6 3/30/2007 v. 1.2.b7 3/31/2007 v. 1.2.b8 4/04/2007 v. 1.2.b9 4/06/2007 v. 1.2.b10 4/13/2007 v. 1.2.b12 5/03/2007 Released under GPL License - http://www.gnu.org/copyleft/gpl.html v. 1.1 Saving scheme updated It's now completely resolution indipendent. Use "Maintain Aspect Ratio" for perfect matching or Apo's free scale: may have no perfect matching (depending on flames) but let you scale in no-proportional way. "Maintain Aspect Ratio" added "Animation Loop" added "Copy first flame's MasterScale/Zoom to each others" added This is an hard-coded testing option (no user-request displayed) Change the "szcopy" variable value. Verbose messages in Script window. v. 1.2.b1 - b7 Raw-save Flame for Apo 2.05 beta2 Supports all varatiations and variations' variables Supports PostXForm Supports FinalXForm Motion Blur supported for all Flam3 version (2.7final and newer still uses the old MotionBlur mode) Advanced Flam3 2.7.x options Linear/Spline frame Intepolation Temporal Sample Motion Blur Standard Motion Blur for Flam3 2.7.x Density Estimator Gamma Threshold Flam3 Filter Shapes Some minor bug fixes in raw-save when Animation Loop option is active One major bug fix in raw-save regarding FinalXForm (forgot to swap some coefs... sorry) A minor bug fix in Flam3 Motion Blur tags creation Minor bug fix regarding paths and file-names with "space" char (Thanks to Piotr Borys for pointing me to this one) Check for at least two Flames (loaded file) Updated Flame's Descriptor (Thanks to Erik Reckase for pointing me to this one) Major bug fixes in Flam3 Spline Interpolation tag creation Changed the ".bat" syntax: easier to read v. 1.2.b8 Complete FinalXForm support: FinalXForm+PostXForm "Apophysis 2.05 Z+ beta2" support (using a dirty trick to implement both versions in the same Script) STEP=1 by default for sequences rendering (single pass) Implementation of simple Batch-rendering LOG File for STEP option v. 1.2.b9 Support for neutral PostXForm and FinalXForm spread better Flam3 rendering (FinalXForm+PostXForm spread will be coded later) FinalXForm complete Color tag support added Automatic Apophysis version check Some minor code optimization regarding PostXForms Flame's names coded as "time___name" Preliminary check of Apophysis Z+ variations against Flam3 supported ones (initial support) Variations names are adressed following Apo2.05 beta2 directives Verbose messages in the Status bar v. 1.2.b10 Bug fix: in some cases the last Transform was duplicated Complete support for neutral PostXForm and FinalXForm spread Intial support for KeyFrames Preview Intepolation default: Smooth (Spline) v. 1.2.b12 Flame Scaling always internally perfomed by Apophysis (perfect matching) Output frames: always saved in the same direcory as generated Flame and .bat files "Transfer MasterScale/Zoom values" option: No, First Flame, Median Preliminary .bat file comments (more in the final release) Check of Apophysis Z+ variations against Flam3 is correct now Filter Radius default value changed to 1 Flam3 "ss" option is always 1 Flam3 buffer depth defaults to 64bits Minor Bug fix: in some rare cases the Loop KF's FinalXForm was duplicated Based on AnimateToFlam3 by Thomas Williams 4/20/2006 pbAnimate by Piotr Borys Thanks to Piotr Borys, Erik Reckase, Thomas Williams, Bill Smith and Fred E. for their valueable support. Usage: First you will have to install flam3, and it's best to place it in a folder called c:\flam3. Then create a folder c:\anims. The .flame and .bat and renders will all end up here. You can change all of this of course, but this makes it easy. After you run the script, you will have a .flame and a .bat file in c:\flam3\anims. Simply doubleclick the .bat file and the rendering will begin. You wont have an animation at the end; you’ll have all the frames. Both Apophysis and Flam3 cannot directly compile an avi or mpeg but they can save only still images. When you have all the frames you can create the final avi/mpeg using an external program; a good free one is the famous VirtualDub, you can find it here: http://www.virtualdub.org/ If you render a preview using the Step option then you also need an utility to rename the frames. Example using Step=3 test_0000.jpg, test_0003.jpg, test_0006.jpg and so on have to be renamed to test_0000.jpg, test_0001.jpg, test_0002.jpg and so on. NEW OPTIONS: Maintain Aspect Ratio Resolution indipendent rendering using Flam3's proprotional scale function resolving some Apophysis scripting scale problems. ACTIVE by default. "Copy first flame's MasterScale/Zoom to each others" All flames will have the same MasterScale and Zoom value; the value is grabbed from the first flame and copied to each others. Hard-coded testing option: change the "szcopy" variable value. STEP usage Frame Step parameter Let you step the frame rendering; useful for preview if you not need to render all frames. Using "Progessive Steps" you can also automaticly progressively complete the whole animation. This way you can have a preview and then render the complete sequence. ;) Progessive Steps parameter Automatic Step refinement: flam3-animate will be automaticly exectuted as many times as need to render the complete animation. Example Frame Step = 3 execute flam3-animate 3 times (one after the other) to complete the whole animation Animation Loop Add the first Flame at the sequence's end to create a complete loop. Example using 3 flames: 0 -> 1 -> 2 -> 0 } ShowMessage('This is an old RenderFlam3 version! Please go to http://exper.3drecursions.com/exper-apophysis-scripts/ and download the latest one!'); exit; // // Preview parameters // pSampleDensity:=5; pOversample:=1; pFilterRadius:=0.4; // // Script parameters // w := 752; h := 564; q := 500; ffilter := 1; o := 2; t := 'jpg'; ba := 60; stp := 1; pstp := 0; aloop := 1; mar := 1; fscale := 0; fzoom := 0; szcopy := 0; cfl:=1; KeyDuration := 100; flam3path := 'c:\flam3\'; outputPath := 'c:\anims\'; batches := 1; flameName := flame.name; fshape := ['bell' , 'blackman' , 'box' , 'bspline' , 'gaussian' , 'hamming' , 'hanning' , 'hermite' , 'mitchell' , 'quadratic' , 'triangle']; tcheck := ['0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0']; apov:=ProgramVersionString; if(apov='Apophysis 2.06 beta') or (apov='Apophysis 2.06c beta') or (apov='Apophysis 2.05 beta 2') then apov:=0; else if (apov='Apophysis 2.06 beta Z+') then begin apov:=1; ShowMessage('"Apophysis 2.06 beta Z+" detected. Preliminary support: - New Variations Variables are not supported.'); end; else if (apov='Apophysis 2.05 Z+ beta 2') then begin if (NVARS=59) then begin apov:=2; ShowMessage('"Apo 2.05 beta2 Z+ C++" detected. Preliminary support: - Only "Apophysis 2.05 Z+ beta 2" compatible Variations Variables are supported. - Variations list will not be checked against Flam3 supported one.'); end; else apov:=1; end; else ShowMessage('Usupported Apophysis version. Currently supported versions are: Apophysis 2.05 beta2, Apophysis 2.06 beta, Apophysis 2.05 Z+ beta2 and Apophysis 2.06 Z+ beta Prelimary support for Apo 2.05 beta2 Z+ C++'); fl:=FileCount-1; if(fl=0) then begin ShowMessage('ERROR: Loaded File should have at least two Flames!'); exit; end; ShowStatus('Render Flam3 Step - Initialization!'); LoadFlame(0); SetActiveTransform(0); with Transform do begin move_x:=0; move_y:=0; split_xsize:=0; split_ysize:=0; split_shift:=0; ngon_sides:=0; ngon_power:=0; ngon_circle:=0; ngon_corners:=0; amw_amp:=0; disc2_rot:=0; disc2_twist:=0; rectangles_x:=0; rectangles_y:=0; super_shape_m:=0; super_shape_n1:=0; super_shape_n2:=0; super_shape_n3:=0; super_shape_rnd:=0; super_shape_holes:=0; radial_blur_angle:=0; rings2_val:=0; fan2_x:=0; fan2_y:=0; blob_low:=0; blob_high:=0; blob_waves:=0; pdj_a:=0; pdj_b:=0; pdj_c:=0; pdj_d:=0; perspective_angle:=0; perspective_dist:=0; julian_power:=0; julian_dist:=0; juliascope_power:=0; juliascope_dist:=0; curl_c1:=0; curl_c2:=0; end; if(apov=1) then begin for fl := 0 to FileCount-1 do begin LoadFlame(fl); for i := 0 to Transforms - 1 do begin SetActiveTransform(i); with Transform do begin vncheck:=variationindex('move') if(variation[vncheck]<>0) then begin ShowMessage('Flame "' + flame.name + '" uses "Move" variation. Flam3 doesn''' + 't support this Variation!'); exit; end; vncheck:=variationindex('split') if(variation[vncheck]<>0) then begin ShowMessage('Flame "' + flame.name + '" uses "Split" variation. Flam3 doesn''' + 't support this Variation!'); exit; end; vncheck:=variationindex('amw') if(variation[vncheck]<>0) then begin ShowMessage('Flame "' + flame.name + '" uses "Amw" variation. Flam3 doesn''' + 't support this Variation!'); exit; end; end; end; end; end; if not InputQuery('Parameter Input', 'Flame Name:', flameName) then exit; if not InputQuery('Parameter Input', 'Output path:', outputPath) then exit; // if not InputQuery('Parameter Input', 'Maintain Aspect Ratio:', mar) then exit; if not InputQuery('Parameter Input', 'Render Width:', w) then exit; if(mar=1) then begin LoadFlame(0); mar := w / flame.Width; h:=flame.Height * mar; end; if not InputQuery('Parameter Input', 'Render Height:', h) then exit; if not InputQuery('Parameter Input', 'Render Quality:', q) then exit; if not InputQuery('Parameter Input', 'Filter Radius:', ffilter) then exit; if not InputQuery('Parameter Input', 'Oversample:', o) then exit; if not InputQuery('Parameter Input', 'Filetype (jpg/png/ppm):', t) then exit; if(t<>'jpg') then if(t<>'png') then if(t<>'ppm') then begin ShowMessage('File Format could be "jpg", "png" or "ppm"'); exit; end; if not InputQuery('Parameter Input', 'Number of frames per animation stage:', KeyDuration) then exit; if not InputQuery('Parameter Input', 'Flam3 software path:', flam3path) then exit; if not InputQuery('Parameter Input', 'Flam3 "Motion Blur" amount: value > 0 for flam3 2.7 and upper value < 0 flam3 2.6', ba) then exit; fadv:=0; if not InputQuery('Parameter Input', 'Flam3 2.7 advanced Parameters: Yes = 1 - No = 0', fadv) then exit; fim:=1; mpas:=1; if(fadv=1) then begin if not InputQuery('Parameter Input', 'Flam3 Interpolation mode: Linear = 0 Smooth '+'('+'Spline'+')'+ ' = 1', fim) then exit; er:=5; if not InputQuery('Parameter Input', 'Flam3 Estimator Radius amount: ', er) then exit; em:=0; if not InputQuery('Parameter Input', 'Flam3 Estimator Minimum amount: ', em) then exit; ec:=0.6; if not InputQuery('Parameter Input', 'Flam3 Estimator Curve amount: ', ec) then exit; gtr:=0.01; if not InputQuery('Parameter Input', 'Flam3 GammaTreshold amount: ', gtr) then exit; fsh:=4; if not InputQuery('Parameter Input', 'Flam3 Filter Shape: bell = 0 - blackman = 1 - box = 2 - bspline = 3 gaussian = 4 - hamming = 5 - hanning = 6 hermite = 7 - mitchell = 8 - quadratic = 9 triangle = 10', fsh) then exit; if not InputQuery('Parameter Input', 'Flam3 "Motion Blur" passes:', mpas) then exit; end; if not InputQuery('Parameter Input', 'Transfer MasterScale/Zoom values: 0 = No 1 = First Flame 2 = Median', szcopy) then exit; if not InputQuery('Parameter Input', 'Animation Loop: 0=No - 1=Yes', aloop) then exit; // // STEP parameters // smax:=0; zmax:=0; InputQuery('Parameter Input', 'Frame Step:', stp); if (stp<=1) then begin stp:=1; pstp:=0; end; else begin InputQuery('Parameter Input', 'Progessive Steps: 0 = No - 1 = Yes', pstp); if(pstp<0) then pstp:=0; else if(pstp>1) then pstp:=1; end; flam3path := Trim(flam3path); outputpath := Trim(outputPath); print('Saving to ' + outputpath + flameName + '.flame'); ShowStatus('Saving to ' + outputpath + flameName + '.flame'); // // "RAW-Write Flame" setup and writing // fxcheck:=0; fxpcheck:=0; if(cfl=1) or (szcopy=2) then begin for fl := 0 to FileCount-1 do begin LoadFlame(fl); if(cfl=1) then begin for i := 0 to 29 - 1 do begin SetActiveTransform(i); tpost:=0; with Transform do begin if(post[0,0]<>1) then tpost:=1; if(post[0,1]<>0) then tpost:=1; if(post[1,0]<>0) then tpost:=1; if(post[1,1]<>1) then tpost:=1; if(post[2,0]<>0) then tpost:=1; if(post[2,1]<>0) then tpost:=1; if(tpost=1) then tcheck[i]:=1; end; end; end; tpost:=0; SetActiveTransform(Transforms); with transform do begin if(a<>1) then tpost:=1; if(b<>0) then tpost:=1; if(c<>0) then tpost:=1; if(d<>1) then tpost:=1; if(e<>0) then tpost:=1; if(f<>0) then tpost:=1; for nvar:=1 to NVARS - 1 do begin if variation[nvar]<>0 then begin tpost:=1; break; end; end; if(tpost=1) then fxcheck:=1; tpost:=0; if(post[0,0]<>1) then tpost:=1; if(post[0,1]<>0) then tpost:=1; if(post[1,0]<>0) then tpost:=1; if(post[1,1]<>1) then tpost:=1; if(post[2,0]<>0) then tpost:=1; if(post[2,1]<>0) then tpost:=1; if(tpost=1) then fxpcheck:=1; end; if(szcopy=2) then begin smax:=smax+flame.Scale; zmax:=zmax+flame.Zoom; end; end; if(szcopy=2) then begin smax:=smax/(FileCount); zmax:=zmax/(FileCount); end; end; tpost:=0; FileList := TStringList.Create; FileList.Add(''); for fl := 0 to FileCount-1 do begin tpost:=0; LoadFlame(fl); flame.SampleDensity := pSampleDensity; flame.Oversample := pOversample; flame.FilterRadius := pFilterRadius; Preview; oScale:=flame.Scale; flame.Width := w; flame.Height := h; SetRenderBounds; flame.SampleDensity := q; flame.Oversample := o; flame.FilterRadius := ffilter; flame.Batches := ba; flame.time := fl* KeyDuration; newFlameName := flameName +'_'+ intToStr(fl); print('Saving ' + newFlameName + ' - Frame: ' + intToStr(flame.time)); ShowStatus('Saving ' + newFlameName + ' - Frame: ' + intToStr(flame.time)); // flame.name := newFlameName; { raw flame write} with flame do begin if(szcopy=1) then begin if(fl=0) then begin nScale:=oScale / 100 * flame.Width; fscale:=nScale; fzoom:=Flame.zoom; end; else begin flame.scale := fscale; flame.zoom := fzoom; end; end; else if(szcopy=2) then begin nScale:=smax / 100 * flame.Width; fscale:=nScale; fzoom:=zmax; end; else if(szcopy=0) then nScale:=oScale / 100 * flame.Width; data:='0) then data:=data + ' zoom="' + FloatToStr(zoom) + '"'; data:= data + ' oversample="' + IntToStr(oversample) + '" filter="' + FloatToStr(FilterRadius) + '"'; if(fsh>=0) then data:= data + ' filter_shape="' + fshape[fsh] + '"'; data:= data + ' quality="' + FloatToStr(SampleDensity) + '"' if(ba<0) then begin ba:=ba+(ba^2); data:= data + ' batches="' + IntToStr(ba)+ '"'; end; else if(ba>0) then begin if(mpas=1) then data:= data + ' passes="1" temporal_samples="' + IntToStr(ba)+ '"'; else data:= data + ' passes="' + IntToStr(mpas) + '" temporal_samples="' + IntToStr(ba)+ '"'; end; data:= data + ' background="'+ FloatToStr(background[0]/255)+ ' '+ FloatToStr(background[1]/255) + ' ' + FloatToStr(background[2]/255) + '" brightness="' + FloatToStr(brightness) + '" gamma="' + FloatToStr(gamma) + '" vibrancy="' + FloatToStr(vibrancy)+ '"'; if(ba>0) then data:= data + ' estimator_radius="' + FloatToStr(er) + '" estimator_minimum="' + FloatToStr(em) + '" estimator_curve="' + FloatToStr(ec) + '"'; if(gtr>=0) then data:=data + ' gamma_threshold="' + FloatToStr(gtr) + '"'; data:=data + ' >'; FileList.Add(data); end; { Write transform parameters } for i := 0 to Transforms - 1 do begin SetActiveTransform(i); with Transform do begin data:=''; data:=data + ' 0 then data:=data + ' symmetry="'+FloatToStr(symmetry)+'"'; for nvar:=0 to NVARS - 1 do begin if variation[nvar]<>0 then data:=data + ' ' + variationname(nvar) + '="' + FloatToStr(variation[nvar]) + '"'; end; tb:=transform.coefs[0,1]-(transform.coefs[0,1]*2); tc:=transform.coefs[1,0]-(transform.coefs[1,0]*2); tf:=transform.coefs[2,1]-(transform.coefs[2,1]*2); data:=data + ' coefs="' + FloatToStr(transform.coefs[0,0]) + ' ' + FloatToStr(tb) + ' ' + FloatToStr(tc) + ' ' + FloatToStr(transform.coefs[1,1]) + ' ' + FloatToStr(transform.coefs[2,0]) + ' ' + FloatToStr(tf) + '"'; if(post[0,0]<>1) then tpost:=1; if(post[0,1]<>0) then tpost:=1; if(post[1,0]<>0) then tpost:=1; if(post[1,1]<>1) then tpost:=1; if(post[2,0]<>0) then tpost:=1; if(post[2,1]<>0) then tpost:=1; if(tpost=1) then begin tb:=transform.post[0,1]-(transform.post[0,1]*2); tc:=transform.post[1,0]-(transform.post[1,0]*2); tf:=transform.post[2,1]-(transform.post[2,1]*2); data:=data + ' post="' + FloatToStr(post[0,0]) + ' ' + FloatToStr(tb) + ' ' + FloatToStr(tc) + ' ' + FloatToStr(post[1,1]) + ' ' + FloatToStr(post[2,0]) + ' ' + FloatToStr(tf) + '"'; end; else begin if(tcheck[i]=1) then data:=data + ' post="1 0 0 1 0 0"'; end; tpost:=0 for nvar:=0 to NVARS - 1 do begin if variation[nvar]<>0 then begin if(variationname(nvar)='radial_blur') then data:=data + ' radial_blur_angle="' + FloatToStr(radial_blur_angle) + '"'; if(variationname(nvar)='rings2') then data:=data + ' rings2_val="' + FloatToStr(rings2_val) + '"'; if(variationname(nvar)='fan2') then data:=data + ' fan2_x="' + FloatToStr(fan2_x) + '"' + ' fan2_y="' + FloatToStr(fan2_y) + '"'; if(variationname(nvar)='blob') then data:=data + ' blob_low="' + FloatToStr(blob_low) + '"' + ' blob_high="' + FloatToStr(blob_high) + '"' + ' blob_waves="' + FloatToStr(blob_waves) + '"'; if(variationname(nvar)='pdj') then data:=data + ' pdj_a="' + FloatToStr(pdj_a) + '"' + ' pdj_b="' + FloatToStr(pdj_b) + '"' + ' pdj_c="' + FloatToStr(pdj_c) + '"' + ' pdj_d="' + FloatToStr(pdj_d) + '"'; if(variationname(nvar)='perspective') then data:=data + ' perspective_angle="' + FloatToStr(perspective_angle) + '"' + ' perspective_dist="' + FloatToStr(perspective_dist) + '"'; if(variationname(nvar)='julian') then data:=data + ' julian_power="' + FloatToStr(julian_power) + '"' + ' julian_dist="' + FloatToStr(julian_dist) + '"'; if(variationname(nvar)='juliascope') then data:=data + ' juliascope_power="' + FloatToStr(juliascope_power) + '"' + ' juliascope_dist="' + FloatToStr(juliascope_dist) + '"'; if(variationname(nvar)='curl') then data:=data + ' curl_c1="' + FloatToStr(curl_c1) + '"' + ' curl_c2="' + FloatToStr(curl_c2) + '"'; if(variationname(nvar)='move') then data:=data + ' move_x="' + FloatToStr(move_x) + '"' + ' move_y="' + FloatToStr(move_y) + '"'; if(variationname(nvar)='split') then data:=data + ' split_xsize="' + FloatToStr(split_xsize) + '"' + ' split_ysize="' + FloatToStr(split_ysize) + '"'; if(variationname(nvar)='ngon') then data:=data + ' ngon_sides="' + FloatToStr(ngon_sides) + '"' + ' ngon_power="' + FloatToStr(ngon_power) + '"' + ' ngon_circle="' + FloatToStr(ngon_circle) + '"' + ' ngon_corners="' + FloatToStr(ngon_corners) + '"'; if(variationname(nvar)='amw') then data:=data + ' amw_amp="' + FloatToStr(amw_amp) + '"'; if(variationname(nvar)='disc2') then data:=data + ' disc2_rot="' + FloatToStr(disc2_rot) + '"' + ' disc2_twist="' + FloatToStr(disc2_twist) + '"'; if(variationname(nvar)='rectangles') then data:=data + ' rectangles_x="' + FloatToStr(rectangles_x) + '"' + ' rectangles_y="' + FloatToStr(rectangles_y) + '"'; if(variationname(nvar)='super_shape') then data:=data + ' super_shape_m="' + FloatToStr(super_shape_m) + '"' + ' super_shape_n1="' + FloatToStr(super_shape_n1) + '"' + ' super_shape_n2="' + FloatToStr(super_shape_n2) + '"' + ' super_shape_n3="' + FloatToStr(super_shape_n3) + '"' + ' super_shape_rnd="' + FloatToStr(super_shape_rnd) + '"' + ' super_shape_holes="' + FloatToStr(super_shape_holes) + '"' end; end; data:=data + ' />' FileList.Add(data); end; end; tpost:=0; SetActiveTransform(Transforms); with transform do begin if(a<>1) then tpost:=1; if(b<>0) then tpost:=1; if(c<>0) then tpost:=1; if(d<>1) then tpost:=1; if(e<>0) then tpost:=1; if(f<>0) then tpost:=1; for nvar:=1 to NVARS - 1 do begin if variation[nvar]<>0 then begin tpost:=1; break; end; end; if(tpost=1) then begin data:=''; data:=data + ' 0 then data:=data + ' symmetry="'+FloatToStr(symmetry)+'"'; for nvar:=0 to NVARS - 1 do begin if variation[nvar]<>0 then data:=data + ' ' + variationname(nvar) + '="' + FloatToStr(variation[nvar]) + '"'; end; tb:=transform.coefs[0,1]-(transform.coefs[0,1]*2); tc:=transform.coefs[1,0]-(transform.coefs[1,0]*2); tf:=transform.coefs[2,1]-(transform.coefs[2,1]*2); data:=data + ' coefs="' + FloatToStr(coefs[0,0]) + ' ' + FloatToStr(tb) + ' ' + FloatToStr(tc) + ' ' + FloatToStr(coefs[1,1]) + ' ' + FloatToStr(coefs[2,0]) + ' ' + FloatToStr(tf) + '"'; tpost:=0; if(post[0,0]<>1) then tpost:=1; if(post[0,1]<>0) then tpost:=1; if(post[1,0]<>0) then tpost:=1; if(post[1,1]<>1) then tpost:=1; if(post[2,0]<>0) then tpost:=1; if(post[2,1]<>0) then tpost:=1; if(tpost=1) then begin tb:=transform.post[0,1]-(transform.post[0,1]*2); tc:=transform.post[1,0]-(transform.post[1,0]*2); tf:=transform.post[2,1]-(transform.post[2,1]*2); data:=data + ' post="' + FloatToStr(post[0,0]) + ' ' + FloatToStr(tb) + ' ' + FloatToStr(tc) + ' ' + FloatToStr(post[1,1]) + ' ' + FloatToStr(post[2,0]) + ' ' + FloatToStr(tf) + '"'; end; else begin if(fxpcheck=1) then data:=data + ' post="1 0 0 1 0 0"'; end; tpost:=0 for nvar:=0 to NVARS - 1 do begin if variation[nvar]<>0 then begin if(variationname(nvar)='radial_blur') then data:=data + ' radial_blur_angle="' + FloatToStr(radial_blur_angle) + '"'; if(variationname(nvar)='rings2') then data:=data + ' rings2_val="' + FloatToStr(rings2_val) + '"'; if(variationname(nvar)='fan2') then data:=data + ' fan2_x="' + FloatToStr(fan2_x) + '"' + ' fan2_y="' + FloatToStr(fan2_y) + '"'; if(variationname(nvar)='blob') then data:=data + ' blob_low="' + FloatToStr(blob_low) + '"' + ' blob_high="' + FloatToStr(blob_high) + '"' + ' blob_waves="' + FloatToStr(blob_waves) + '"'; if(variationname(nvar)='pdj') then data:=data + ' pdj_a="' + FloatToStr(pdj_a) + '"' + ' pdj_b="' + FloatToStr(pdj_b) + '"' + ' pdj_c="' + FloatToStr(pdj_c) + '"' + ' pdj_d="' + FloatToStr(pdj_d) + '"'; if(variationname(nvar)='perspective') then data:=data + ' perspective_angle="' + FloatToStr(perspective_angle) + '"' + ' perspective_dist="' + FloatToStr(perspective_dist) + '"'; if(variationname(nvar)='julian') then data:=data + ' julian_power="' + FloatToStr(julian_power) + '"' + ' julian_dist="' + FloatToStr(julian_dist) + '"'; if(variationname(nvar)='juliascope') then data:=data + ' juliascope_power="' + FloatToStr(juliascope_power) + '"' + ' juliascope_dist="' + FloatToStr(juliascope_dist) + '"'; if(variationname(nvar)='curl') then data:=data + ' curl_c1="' + FloatToStr(curl_c1) + '"' + ' curl_c2="' + FloatToStr(curl_c2) + '"'; if(variationname(nvar)='move') then data:=data + ' move_x="' + FloatToStr(move_x) + '"' + ' move_y="' + FloatToStr(move_y) + '"'; if(variationname(nvar)='split') then data:=data + ' split_xsize="' + FloatToStr(split_xsize) + '"' + ' split_ysize="' + FloatToStr(split_ysize) + '"'; if(variationname(nvar)='ngon') then data:=data + ' ngon_sides="' + FloatToStr(ngon_sides) + '"' + ' ngon_power="' + FloatToStr(ngon_power) + '"' + ' ngon_circle="' + FloatToStr(ngon_circle) + '"' + ' ngon_corners="' + FloatToStr(ngon_corners) + '"'; if(variationname(nvar)='amw') then data:=data + ' amw_amp="' + FloatToStr(amw_amp) + '"'; if(variationname(nvar)='disc2') then data:=data + ' disc2_rot="' + FloatToStr(disc2_rot) + '"' + ' disc2_twist="' + FloatToStr(disc2_twist) + '"'; if(variationname(nvar)='rectangles') then data:=data + ' rectangles_x="' + FloatToStr(rectangles_x) + '"' + ' rectangles_y="' + FloatToStr(rectangles_y) + '"'; if(variationname(nvar)='super_shape') then data:=data + ' super_shape_m="' + FloatToStr(super_shape_m) + '"' + ' super_shape_n1="' + FloatToStr(super_shape_n1) + '"' + ' super_shape_n2="' + FloatToStr(super_shape_n2) + '"' + ' super_shape_n3="' + FloatToStr(super_shape_n3) + '"' + ' super_shape_rnd="' + FloatToStr(super_shape_rnd) + '"' + ' super_shape_holes="' + FloatToStr(super_shape_holes) + '"' end; end; data:=data + '/>' FileList.Add(data); end; else begin if(fxcheck=1) then begin data:= ' '; FileList.Add(data); end; end; end; { Write palette data } for i := 0 to 255 do begin FileList.Add(' '); end; FileList.Add(''); end; if(aloop=1) then begin tpost:=0; LoadFlame(0); flame.SampleDensity := pSampleDensity; flame.Oversample := pOversample; flame.FilterRadius := pFilterRadius; Preview; oScale:=flame.Scale; flame.Width := w; flame.Height := h; SetRenderBounds; flame.SampleDensity := q; flame.Oversample := o; flame.FilterRadius := ffilter; flame.Batches := ba; flame.time := FileCount * KeyDuration; newFlameName := flameName +'_'+ intToStr(fl); print('Saving ' + newFlameName + ' - Frame: ' + intToStr(flame.time) + ' - Loop KeyFrame'); ShowStatus('Saving ' + newFlameName + ' - Frame: ' + intToStr(flame.time) + ' - Loop KeyFrame'); // flame.name := newFlameName; with flame do begin if(szcopy=1) then begin if(fl=0) then begin nScale:=oScale / 100 * flame.Width; fscale:=nScale; fzoom:=Flame.zoom; end; else begin flame.scale := fscale; flame.zoom := fzoom; end; end; else if(szcopy=2) then begin nScale:=smax / 100 * flame.Width; fscale:=nScale; fzoom:=zmax; end; else if(szcopy=0) then nScale:=oScale / 100 * flame.Width; data:='0) then data:=data + ' zoom="' + FloatToStr(zoom) + '"'; data:= data + ' oversample="' + IntToStr(oversample) + '" filter="' + FloatToStr(FilterRadius) + '"'; if(fsh>=0) then data:= data + ' filter_shape="' + fshape[fsh] + '"'; data:= data + ' quality="' + FloatToStr(SampleDensity) + '"' if(ba<0) then begin ba:=ba+(ba^2); data:= data + ' batches="' + IntToStr(ba)+ '"'; end; else if(ba>0) then begin if(mpas=1) then data:= data + ' passes="1" temporal_samples="' + IntToStr(ba)+ '"'; else data:= data + ' passes="' + IntToStr(mpas) + '" temporal_samples="' + IntToStr(ba)+ '"'; end; data:= data + ' background="'+ FloatToStr(background[0]/255)+ ' '+ FloatToStr(background[1]/255) + ' ' + FloatToStr(background[2]/255) + '" brightness="' + FloatToStr(brightness) + '" gamma="' + FloatToStr(gamma) + '" vibrancy="' + FloatToStr(vibrancy)+ '"'; if(ba>0) then data:= data + ' estimator_radius="' + FloatToStr(er) + '" estimator_minimum="' + FloatToStr(em) + '" estimator_curve="' + FloatToStr(ec) + '"'; if(gtr>=0) then data:=data + ' gamma_threshold="' + FloatToStr(gtr) + '"'; data:=data + ' >'; FileList.Add(data); end; { Write transform parameters } for i := 0 to Transforms - 1 do begin SetActiveTransform(i); with Transform do begin data:=''; data:=data + ' 0 then data:=data + ' symmetry="'+FloatToStr(symmetry)+'"'; for nvar:=0 to NVARS - 1 do begin if variation[nvar]<>0 then data:=data + ' ' + variationname(nvar) + '="' + FloatToStr(variation[nvar]) + '"'; end; tb:=transform.coefs[0,1]-(transform.coefs[0,1]*2); tc:=transform.coefs[1,0]-(transform.coefs[1,0]*2); tf:=transform.coefs[2,1]-(transform.coefs[2,1]*2); data:=data + ' coefs="' + FloatToStr(transform.coefs[0,0]) + ' ' + FloatToStr(tb) + ' ' + FloatToStr(tc) + ' ' + FloatToStr(transform.coefs[1,1]) + ' ' + FloatToStr(transform.coefs[2,0]) + ' ' + FloatToStr(tf) + '"'; tpost:=0; if(post[0,0]<>1) then tpost:=1; if(post[0,1]<>0) then tpost:=1; if(post[1,0]<>0) then tpost:=1; if(post[1,1]<>1) then tpost:=1; if(post[2,0]<>0) then tpost:=1; if(post[2,1]<>0) then tpost:=1; if(tpost=1) then begin tb:=transform.post[0,1]-(transform.post[0,1]*2); tc:=transform.post[1,0]-(transform.post[1,0]*2); tf:=transform.post[2,1]-(transform.post[2,1]*2); data:=data + ' post="' + FloatToStr(post[0,0]) + ' ' + FloatToStr(tb) + ' ' + FloatToStr(tc) + ' ' + FloatToStr(post[1,1]) + ' ' + FloatToStr(post[2,0]) + ' ' + FloatToStr(tf) + '"'; end; else begin if(tcheck[i]=1) then data:=data + ' post="1 0 0 1 0 0"'; end; tpost:=0 for nvar:=0 to NVARS - 1 do begin if variation[nvar]<>0 then begin if(variationname(nvar)='radial_blur') then data:=data + ' radial_blur_angle="' + FloatToStr(radial_blur_angle) + '"'; if(variationname(nvar)='rings2') then data:=data + ' rings2_val="' + FloatToStr(rings2_val) + '"'; if(variationname(nvar)='fan2') then data:=data + ' fan2_x="' + FloatToStr(fan2_x) + '"' + ' fan2_y="' + FloatToStr(fan2_y) + '"'; if(variationname(nvar)='blob') then data:=data + ' blob_low="' + FloatToStr(blob_low) + '"' + ' blob_high="' + FloatToStr(blob_high) + '"' + ' blob_waves="' + FloatToStr(blob_waves) + '"'; if(variationname(nvar)='pdj') then data:=data + ' pdj_a="' + FloatToStr(pdj_a) + '"' + ' pdj_b="' + FloatToStr(pdj_b) + '"' + ' pdj_c="' + FloatToStr(pdj_c) + '"' + ' pdj_d="' + FloatToStr(pdj_d) + '"'; if(variationname(nvar)='perspective') then data:=data + ' perspective_angle="' + FloatToStr(perspective_angle) + '"' + ' perspective_dist="' + FloatToStr(perspective_dist) + '"'; if(variationname(nvar)='julian') then data:=data + ' julian_power="' + FloatToStr(julian_power) + '"' + ' julian_dist="' + FloatToStr(julian_dist) + '"'; if(variationname(nvar)='juliascope') then data:=data + ' juliascope_power="' + FloatToStr(juliascope_power) + '"' + ' juliascope_dist="' + FloatToStr(juliascope_dist) + '"'; if(variationname(nvar)='curl') then data:=data + ' curl_c1="' + FloatToStr(curl_c1) + '"' + ' curl_c2="' + FloatToStr(curl_c2) + '"'; if(variationname(nvar)='move') then data:=data + ' move_x="' + FloatToStr(move_x) + '"' + ' move_y="' + FloatToStr(move_y) + '"'; if(variationname(nvar)='split') then data:=data + ' split_xsize="' + FloatToStr(split_xsize) + '"' + ' split_ysize="' + FloatToStr(split_ysize) + '"'; if(variationname(nvar)='ngon') then data:=data + ' ngon_sides="' + FloatToStr(ngon_sides) + '"' + ' ngon_power="' + FloatToStr(ngon_power) + '"' + ' ngon_circle="' + FloatToStr(ngon_circle) + '"' + ' ngon_corners="' + FloatToStr(ngon_corners) + '"'; if(variationname(nvar)='amw') then data:=data + ' amw_amp="' + FloatToStr(amw_amp) + '"'; if(variationname(nvar)='disc2') then data:=data + ' disc2_rot="' + FloatToStr(disc2_rot) + '"' + ' disc2_twist="' + FloatToStr(disc2_twist) + '"'; if(variationname(nvar)='rectangles') then data:=data + ' rectangles_x="' + FloatToStr(rectangles_x) + '"' + ' rectangles_y="' + FloatToStr(rectangles_y) + '"'; if(variationname(nvar)='super_shape') then data:=data + ' super_shape_m="' + FloatToStr(super_shape_m) + '"' + ' super_shape_n1="' + FloatToStr(super_shape_n1) + '"' + ' super_shape_n2="' + FloatToStr(super_shape_n2) + '"' + ' super_shape_n3="' + FloatToStr(super_shape_n3) + '"' + ' super_shape_rnd="' + FloatToStr(super_shape_rnd) + '"' + ' super_shape_holes="' + FloatToStr(super_shape_holes) + '"' end; end; data:=data + ' />' FileList.Add(data); end; end; tpost:=0; SetActiveTransform(Transforms); with transform do begin if(a<>1) then tpost:=1; if(b<>0) then tpost:=1; if(c<>0) then tpost:=1; if(d<>1) then tpost:=1; if(e<>0) then tpost:=1; if(f<>0) then tpost:=1; for nvar:=1 to NVARS - 1 do begin if variation[nvar]<>0 then begin tpost:=1; break; end; end; if(tpost=1) then begin data:=''; data:=data + ' 0 then data:=data + ' symmetry="'+FloatToStr(symmetry)+'"'; for nvar:=0 to NVARS - 1 do begin if variation[nvar]<>0 then data:=data + ' ' + variationname(nvar) + '="' + FloatToStr(variation[nvar]) + '"'; end; tb:=transform.coefs[0,1]-(transform.coefs[0,1]*2); tc:=transform.coefs[1,0]-(transform.coefs[1,0]*2); tf:=transform.coefs[2,1]-(transform.coefs[2,1]*2); data:=data + ' coefs="' + FloatToStr(coefs[0,0]) + ' ' + FloatToStr(tb) + ' ' + FloatToStr(tc) + ' ' + FloatToStr(coefs[1,1]) + ' ' + FloatToStr(coefs[2,0]) + ' ' + FloatToStr(tf) + '"'; tpost:=0 if(post[0,0]<>1) then tpost:=1; if(post[0,1]<>0) then tpost:=1; if(post[1,0]<>0) then tpost:=1; if(post[1,1]<>1) then tpost:=1; if(post[2,0]<>0) then tpost:=1; if(post[2,1]<>0) then tpost:=1; if(tpost=1) then begin tb:=transform.post[0,1]-(transform.post[0,1]*2); tc:=transform.post[1,0]-(transform.post[1,0]*2); tf:=transform.post[2,1]-(transform.post[2,1]*2); data:=data + ' post="' + FloatToStr(post[0,0]) + ' ' + FloatToStr(tb) + ' ' + FloatToStr(tc) + ' ' + FloatToStr(post[1,1]) + ' ' + FloatToStr(post[2,0]) + ' ' + FloatToStr(tf) + '"'; end; else begin if(fxpcheck=1) then data:=data + ' post="1 0 0 1 0 0"'; end; for nvar:=0 to NVARS - 1 do begin if variation[nvar]<>0 then begin if(variationname(nvar)='radial_blur') then data:=data + ' radial_blur_angle="' + FloatToStr(radial_blur_angle) + '"'; if(variationname(nvar)='rings2') then data:=data + ' rings2_val="' + FloatToStr(rings2_val) + '"'; if(variationname(nvar)='fan2') then data:=data + ' fan2_x="' + FloatToStr(fan2_x) + '"' + ' fan2_y="' + FloatToStr(fan2_y) + '"'; if(variationname(nvar)='blob') then data:=data + ' blob_low="' + FloatToStr(blob_low) + '"' + ' blob_high="' + FloatToStr(blob_high) + '"' + ' blob_waves="' + FloatToStr(blob_waves) + '"'; if(variationname(nvar)='pdj') then data:=data + ' pdj_a="' + FloatToStr(pdj_a) + '"' + ' pdj_b="' + FloatToStr(pdj_b) + '"' + ' pdj_c="' + FloatToStr(pdj_c) + '"' + ' pdj_d="' + FloatToStr(pdj_d) + '"'; if(variationname(nvar)='perspective') then data:=data + ' perspective_angle="' + FloatToStr(perspective_angle) + '"' + ' perspective_dist="' + FloatToStr(perspective_dist) + '"'; if(variationname(nvar)='julian') then data:=data + ' julian_power="' + FloatToStr(julian_power) + '"' + ' julian_dist="' + FloatToStr(julian_dist) + '"'; if(variationname(nvar)='juliascope') then data:=data + ' juliascope_power="' + FloatToStr(juliascope_power) + '"' + ' juliascope_dist="' + FloatToStr(juliascope_dist) + '"'; if(variationname(nvar)='curl') then data:=data + ' curl_c1="' + FloatToStr(curl_c1) + '"' + ' curl_c2="' + FloatToStr(curl_c2) + '"'; if(variationname(nvar)='move') then data:=data + ' move_x="' + FloatToStr(move_x) + '"' + ' move_y="' + FloatToStr(move_y) + '"'; if(variationname(nvar)='split') then data:=data + ' split_xsize="' + FloatToStr(split_xsize) + '"' + ' split_ysize="' + FloatToStr(split_ysize) + '"'; if(variationname(nvar)='ngon') then data:=data + ' ngon_sides="' + FloatToStr(ngon_sides) + '"' + ' ngon_power="' + FloatToStr(ngon_power) + '"' + ' ngon_circle="' + FloatToStr(ngon_circle) + '"' + ' ngon_corners="' + FloatToStr(ngon_corners) + '"'; if(variationname(nvar)='amw') then data:=data + ' amw_amp="' + FloatToStr(amw_amp) + '"'; if(variationname(nvar)='disc2') then data:=data + ' disc2_rot="' + FloatToStr(disc2_rot) + '"' + ' disc2_twist="' + FloatToStr(disc2_twist) + '"'; if(variationname(nvar)='rectangles') then data:=data + ' rectangles_x="' + FloatToStr(rectangles_x) + '"' + ' rectangles_y="' + FloatToStr(rectangles_y) + '"'; if(variationname(nvar)='super_shape') then data:=data + ' super_shape_m="' + FloatToStr(super_shape_m) + '"' + ' super_shape_n1="' + FloatToStr(super_shape_n1) + '"' + ' super_shape_n2="' + FloatToStr(super_shape_n2) + '"' + ' super_shape_n3="' + FloatToStr(super_shape_n3) + '"' + ' super_shape_rnd="' + FloatToStr(super_shape_rnd) + '"' + ' super_shape_holes="' + FloatToStr(super_shape_holes) + '"' end; end; data:=data + '/>' FileList.Add(data); end; else begin if(fxcheck=1) then begin data:= ' '; FileList.Add(data); end; end; end; { Write palette data } for i := 0 to 255 do begin FileList.Add(' '); end; FileList.Add(''); end; FileList.Add(''); FileList.SaveToFile(outputpath + flameName + '.flame'); FileList.Free; // // Creating a batch file controlling flam3-animate program // FileList := TstringList.create; FileList.Add('@echo off'); FileList.Add('set verbose=1'); FileList.Add('set nframes=' + IntToStr(KeyDuration)); FileList.Add('set format=' + t); FileList.Add('set loops=0'); FileList.Add('set dtime=1'); FileList.Add('set bits=64'); FileList.Add('set prefix=' + FlameName + '_'); FileList.Add(''); FileList.Add('REM Change "ss" value to multiple/divide generated Flame-file resolution.'); FileList.Add('set ss=1'); FileList.Add(''); FileList.Add('REM Change "begin" value to continue a stopped sequence-rendering'); FileList.Add('set begin=0'); FileList.Add(''); // // STEPS code // if(stp>1) then FileList.Add('set dtime=' + IntToStr(stp)); if(pstp=1) then begin for sts:=0 to stp -1 do begin if(stp>1) then begin FileList.Add('@echo ---- Step '+ IntToStr(sts)+ ' ----'); FileList.Add('@echo ---- Step '+ IntToStr(sts)+ ' ---- >> "' + outputpath + flameName + '_log.txt"'); end; FileList.Add('set begin=' + IntToStr(sts)); FileList.Add('"' + flam3path + 'flam3-animate.exe" < "' + FlameName + '.flame"'); if(stp>1) then begin FileList.Add('@echo ---- Step '+ IntToStr(sts)+ ' COMPLETED ----'); FileList.Add('@echo ---- Step '+ IntToStr(sts)+ ' COMPLETED ---- >> "' + outputpath + flameName + '_log.txt"'); end; end; end; else FileList.Add('"' + flam3path + 'flam3-animate.exe" < "' + FlameName + '.flame"'); // // Ending code // if(pstp=1) then FileList.Add('del "' + outputpath + flameName + '_log.txt"'); FileList.SaveToFile(outputpath + flameName + '_animate.bat'); FileList.Free; UpdateFlame := False; print('Now you can execute the batch file named ''' + OutputPATH + FlameName + '_animate.bat'''); ShowStatus('Now you can execute the batch file named ''' + OutputPATH + FlameName + '_animate.bat'''); ShowMessage('Now you can execute the batch file named ''' + OutputPATH + FlameName + '-animate.bat'' which will create your animation!'); UpdateFlame := False;