// --------------------------------------------------------------- // Generate an HTML file in order to have all values at a glance. // Generates one file with all flames from the open flameset. // created by tomix (Tom Hendriks [tomix_@_tomixart_._com]) // Version 0.97.206c3D last modified on 2007.12.23 // --------------------------------------------------------------- // You are free to modify these settings Path := INSTALLPATH + 'HTML\'; // Adapt to your needs makeThumbnail := 1; // Create thumbnail image to include in HTML displayAllVars := 0; // 0 = display only Variations which are in use. // 1 = display complete set of Variations even if not used. displayGradient := 0; // 0 = disable , 1 = enable // Attention: if enabled, it creates 14.5K of HTML source more for each flame // so imagine you have a flameset with 50 flames, this makes additional 725K! // START: DO NOT MODIFY AS OF HERE FlameSetFile := ExtractFileName(CurrentFile); RawFileName := Copy(FlameSetFile, 0, Pos('.flame',FlameSetFile)-1); if not DirectoryExists(Path) then x := CreateDir(Path); if x = 'False' then exit; Path := Path + RawFileName + '\'; if not DirectoryExists(Path) then x := CreateDir(Path); if x = 'False' then exit; // Create file FileList := TStringList.Create; FileList.Add(''); FileList.Add(''); FileList.Add(''); FileList.Add('' + FlameSetFile + ''); FileList.Add(''); FileList.Add(''); FileList.Add(''); FileList.Add(''); FileList.Add('

Apophysis Flameset: ' + CurrentFile + '

'); for i := 0 to FileCount - 1 do begin LoadFlame(i); ShowStatus('Processing '+Flame.Name+', #'+IntToStr(i+1)+' of '+IntToStr(FileCount)); if makeThumbnail > 0 then begin Org_SampleDensity := Flame.SampleDensity; Org_Oversample := Flame.Oversample; Org_FilterRadius := Flame.FilterRadius; Org_Width := Renderer.Width; Org_Height := Renderer.Height; Flame.SampleDensity := 100; Flame.Oversample := 1; Flame.FilterRadius := 0.8; Renderer.Width := 200; // Renderer.Height := 160; Renderer.Height := Renderer.Width / Org_Width * Org_Height; Renderer.Filename := Path + Flame.Name + '.jpg'; SetRenderBounds; Render; end; FileList.Add('
'); FileList.Add('' + IntToStr(i + 1) + ' ' + Flame.Name + ' '); if (Flame.Nick <> '') then FileList.Add('by ' + Flame.Nick + ' '); if (Flame.URL <> '') then FileList.Add('(' + Flame.URL + ')'); FileList.Add(''); FileList.Add(''); FileList.Add(''); // ***** Transforms pane ***** FileList.Add(''); FileList.Add(''); FileList.Add('
'); // ***** Flame parameters ***** FileList.Add(''); FileList.Add(''); if makeThumbnail > 0 then FileList.Add(''); // Display of params as of here (Adjust Panel: Rendering and Camera) FileList.Add(''); FileList.Add(''); FileList.Add(''); FileList.Add(''); FileList.Add(''); if Pos('3D', ProgramVersionString) > 0 then begin FileList.Add(''); FileList.Add(''); FileList.Add(''); FileList.Add(''); FileList.Add(''); end; FileList.Add(''); FileList.Add(''); FileList.Add(''); FileList.Add(''); FileList.Add(''); FileList.Add(''); FileList.Add(''); FileList.Add(''); FileList.Add('
Name' + Flame.name + '
Version' + ProgramVersionString + '
Size' + IntToStr(Flame.width) + 'x' + IntToStr(Flame.height) + ' px
X Position' + Format('%.4f', [Flame.X]) + '
Y Position' + Format('%.4f', [Flame.Y]) + '
Z Position' + Format('%.4f', [RadToDeg(Flame.Z)]) + '
Perspective' + Format('%.4f', [Flame.perspective]) + '
DOF' + Format('%.3f', [Flame.dof]) + '
Pitch' + Format('%.2f', [RadToDeg(Flame.pitch)]) + '
Yaw' + Format('%.2f', [RadToDeg(Flame.yaw)]) + '
Rotation' + Format('%.2f', [RadToDeg(Flame.angle)]) + '
Zoom' + Format('%.3f', [Flame.Zoom]) + '
Scale' + Format('%.4f', [Flame.Scale]) + '
Gamma' + Format('%.2f', [Flame.Gamma]) + '
Brightness' + Format('%.2f', [Flame.Brightness]) + '
Vibrancy' + Format('%.2f', [Flame.Vibrancy]) + '
Background 
'); FileList.Add('
'); FileList.Add(''); FileList.Add(''); fx := 0; tf := Transforms; FileList.Add(''); FileList.Add(''); SetActiveTransform(Transforms); if Flame.FinalXformEnabled then fx := 1; for Xform := 0 to tf do begin if (fx > 0) And (Xform = tf) then FileList.Add(''); else if (Xform <> tf) then FileList.Add(''); end; FileList.Add(''); if fx > 0 then tf := Transforms+1; // Display COEFS FileList.Add(''); FileList.Add(''); for Xform := 0 to tf-1 do begin SetActiveTransform(Xform); FileList.Add(''); end; FileList.Add(''); FileList.Add(''); FileList.Add(''); for Xform := 0 to tf-1 do begin SetActiveTransform(Xform); FileList.Add(''); end; FileList.Add(''); FileList.Add(''); FileList.Add(''); for Xform := 0 to tf-1 do begin SetActiveTransform(Xform); FileList.Add(''); end; FileList.Add(''); FileList.Add(''); FileList.Add(''); for Xform := 0 to tf-1 do begin SetActiveTransform(Xform); FileList.Add(''); end; FileList.Add(''); FileList.Add(''); FileList.Add(''); for Xform := 0 to tf-1 do begin SetActiveTransform(Xform); FileList.Add(''); end; FileList.Add(''); FileList.Add(''); FileList.Add(''); for Xform := 0 to tf-1 do begin SetActiveTransform(Xform); FileList.Add(''); end; FileList.Add(''); // POST transforms // First check if any post-transforms are used on any transform Xform := 0; isPost:=0; for Xform := 0 to tf-1 do begin SetActiveTransform(Xform); if (Transform.post[0,0]<>1) or (Transform.post[0,1]<>0) or (Transform.post[1,0]<>0) or (Transform.post[1,1]<>1) or (Transform.post[2,0]<>0) or (Transform.post[2,1]<>0) then inc(isPost); end; // Then, if at least one was found, check for each transform to display them if isPost > 0 then begin FileList.Add(''); FileList.Add(''); for XPform := 0 to tf-1 do begin SetActiveTransform(XPform) if(Transform.post[0,0]<>1) or (Transform.post[0,1]<>0) or (Transform.post[1,0]<>0) or (Transform.post[1,1]<>1) or (Transform.post[2,0]<>0) or (Transform.post[2,1]<>0) then FileList.Add(''); else FileList.Add(''); end; FileList.Add(''); FileList.Add(''); FileList.Add(''); for XPform := 0 to tf-1 do begin SetActiveTransform(XPform) if(Transform.post[0,0]<>1) or (Transform.post[0,1]<>0) or (Transform.post[1,0]<>0) or (Transform.post[1,1]<>1) or (Transform.post[2,0]<>0) or (Transform.post[2,1]<>0) then FileList.Add(''); else FileList.Add(''); end; FileList.Add(''); FileList.Add(''); FileList.Add(''); for XPform := 0 to tf-1 do begin SetActiveTransform(XPform) if(Transform.post[0,0]<>1) or (Transform.post[0,1]<>0) or (Transform.post[1,0]<>0) or (Transform.post[1,1]<>1) or (Transform.post[2,0]<>0) or (Transform.post[2,1]<>0) then FileList.Add(''); else FileList.Add(''); end; FileList.Add(''); FileList.Add(''); FileList.Add(''); for XPform := 0 to tf-1 do begin SetActiveTransform(XPform) if(Transform.post[0,0]<>1) or (Transform.post[0,1]<>0) or (Transform.post[1,0]<>0) or (Transform.post[1,1]<>1) or (Transform.post[2,0]<>0) or (Transform.post[2,1]<>0) then FileList.Add(''); else FileList.Add(''); end; FileList.Add(''); FileList.Add(''); FileList.Add(''); for XPform := 0 to tf-1 do begin SetActiveTransform(XPform) if(Transform.post[0,0]<>1) or (Transform.post[0,1]<>0) or (Transform.post[1,0]<>0) or (Transform.post[1,1]<>1) or (Transform.post[2,0]<>0) or (Transform.post[2,1]<>0) then FileList.Add(''); else FileList.Add(''); end; FileList.Add(''); FileList.Add(''); FileList.Add(''); for XPform := 0 to tf-1 do begin SetActiveTransform(XPform) if(Transform.post[0,0]<>1) or (Transform.post[0,1]<>0) or (Transform.post[1,0]<>0) or (Transform.post[1,1]<>1) or (Transform.post[2,0]<>0) or (Transform.post[2,1]<>0) then FileList.Add(''); else FileList.Add(''); end; FileList.Add(''); end; // Display Weight, Symmetry and Color FileList.Add(''); FileList.Add(''); for Xform := 0 to tf-1 do begin SetActiveTransform(Xform); if (Xform = Transforms) And (fx > 0) then FileList.Add(''); else FileList.Add(''); end; FileList.Add(''); FileList.Add(''); FileList.Add(''); for Xform := 0 to tf-1 do begin SetActiveTransform(Xform); FileList.Add(''); end; FileList.Add(''); FileList.Add(''); FileList.Add(''); for Xform := 0 to tf-1 do begin SetActiveTransform(Xform); FileList.Add(''); end; FileList.Add(''); // Display VARIATIONS for Vars := 0 to NVARS - 1 do begin // Test if this variation should be on display displayAllow := 0; if displayAllVars > 0 then displayAllow := 1; else begin VarVal := 0; for Xform := 0 to tf-1 do begin SetActiveTransform(Xform); VarVal := VarVal + Transform.Variation[Vars]; end; if VarVal <> 0 then displayAllow := 1; end // Show the row for this variation if allowed if displayAllow = 1 then begin FileList.Add(''); FileList.Add(''); for Xform := 0 to tf-1 do begin SetActiveTransform(Xform); if (Transform.Variation[Vars] = 0) then FileList.Add(''); else FileList.Add(''); end; FileList.Add(''); // Display VARIABLES if any for this variation for varia := 0 to NumVariables do begin oscope := 0; wedge := 0; if (VariationName(Vars)='oscilloscope') and Pos('oscope_', VariableName(varia)) = 1 then oscope:=1; // if VariationName(Vars)='wedge' and (Pos('wedge_j', VariableName(varia)) = 0 and Pos('wedge_s', VariableName(varia)) = 0) then wedge:=1; // if ((oscope=1 or wedge=1) or (Pos(VariationName(Vars)+'_', VariableName(varia)) = 1)) then begin if ((oscope=1) or (Pos(VariationName(Vars)+'_', VariableName(varia)) = 1)) then begin FileList.Add(''); FileList.Add(''); for Xform := 0 to tf-1 do begin SetActiveTransform(Xform); if (Transform.Variation[Vars] = 0) then FileList.Add(''); else FileList.Add(''); end; FileList.Add(''); end; end; end; end; FileList.Add(''); FileList.Add('
TransformFinal' + IntToStr(Xform + 1) + '
Xx' + Format('%.6f', [Transform.A]) + '
Xy' + Format('%.6f', [0 - Transform.C]) + '
Yx' + Format('%.6f', [0 - Transform.B]) + '
Yy' + Format('%.6f', [Transform.D]) + '
Ox' + Format('%.6f', [Transform.E]) + '
Oy' + Format('%.6f', [0 - Transform.F]) + '
post Xx' + Format('%.6f', [Transform.post[0,0]]) + ' 
post Xy' + Format('%.6f', [Transform.post[0,1]]) + ' 
post Yx' + Format('%.6f', [Transform.post[1,0]]) + ' 
post Yy' + Format('%.6f', [Transform.post[1,1]]) + ' 
post Ox' + Format('%.6f', [Transform.post[2,0]]) + ' 
post Oy' + Format('%.6f', [Transform.post[2,1]]) + ' 
Weight ' + Format('%.4f', [Transform.Weight]) + '
Symmetry' + Format('%.4f', [Transform.Symmetry]) + '
Color' + Format('%.3f', [Transform.Color]) + '
' + VariationName(Vars) + ' ' + Format('%.6f', [Transform.Variation[Vars]]) + '
'+VariableName(varia)+' ' + Format('%.4f', [Transform.Variable[varia]]) + '
'); FileList.Add('
'); // Gradient data if displayGradient = 1 then begin FileList.Add(''); for g := 0 to 255 do begin FileList.Add(''); end; FileList.Add('
 
'); end; end; FileList.Add(''); FileList.Add(''); FileList.SaveToFile(Path + RawFileName + '.html'); FileList.Free; ShowStatus('HTML file '+Path+RawFileName+'.html created.'); ShowMessage('HTML file '+Path+RawFileName+'.html created.'); UpdateFlame := False;