more things accessible from scripter...
This commit is contained in:
parent
59986c697a
commit
658b2e25b7
@ -153,6 +153,8 @@ type
|
|||||||
procedure GetFlameURLProc(AMachine: TatVirtualMachine);
|
procedure GetFlameURLProc(AMachine: TatVirtualMachine);
|
||||||
procedure SetFlameBatchesProc(AMachine: TatVirtualMachine);
|
procedure SetFlameBatchesProc(AMachine: TatVirtualMachine);
|
||||||
procedure GetFlameBatchesProc(AMachine: TatVirtualMachine);
|
procedure GetFlameBatchesProc(AMachine: TatVirtualMachine);
|
||||||
|
procedure GetFlameFinalxformEnabledProc(AMachine: TatVirtualMachine);
|
||||||
|
procedure SetFlameFinalxformEnabledProc(AMachine: TatVirtualMachine);
|
||||||
|
|
||||||
{ Transform interface }
|
{ Transform interface }
|
||||||
procedure GetTransformAProc(AMachine: TatVirtualMachine);
|
procedure GetTransformAProc(AMachine: TatVirtualMachine);
|
||||||
@ -1539,7 +1541,6 @@ begin
|
|||||||
if nxform < NXFORMS then
|
if nxform < NXFORMS then
|
||||||
for i := nxform to NXFORMS - 1 do
|
for i := nxform to NXFORMS - 1 do
|
||||||
cp1.xform[i].density := 0;
|
cp1.xform[i].density := 0;
|
||||||
// --?-- cp1.NormalizeWeights;
|
|
||||||
// Check for symmetry parameter
|
// Check for symmetry parameter
|
||||||
if cp1.symmetry <> 0 then
|
if cp1.symmetry <> 0 then
|
||||||
begin
|
begin
|
||||||
@ -1582,7 +1583,6 @@ begin
|
|||||||
for i := 0 to NXFORMS - 1 do
|
for i := 0 to NXFORMS - 1 do
|
||||||
if ScriptEditor.cp.xform[i].density = 0 then break;
|
if ScriptEditor.cp.xform[i].density = 0 then break;
|
||||||
NumTransforms := i;
|
NumTransforms := i;
|
||||||
// --?-- ScriptEditor.cp.NormalizeWeights;
|
|
||||||
// FlameName := FileList[index];
|
// FlameName := FileList[index];
|
||||||
finally
|
finally
|
||||||
IFSStrings.Free;
|
IFSStrings.Free;
|
||||||
@ -1654,7 +1654,6 @@ begin
|
|||||||
for i := 0 to NXFORMS - 1 do
|
for i := 0 to NXFORMS - 1 do
|
||||||
if ScriptEditor.cp.xform[i].density = 0 then break;
|
if ScriptEditor.cp.xform[i].density = 0 then break;
|
||||||
NumTransforms := i;
|
NumTransforms := i;
|
||||||
// --?-- ScriptEditor.cp.NormalizeWeights;
|
|
||||||
if SavedPal then ScriptEditor.cp.cmap := Palette;
|
if SavedPal then ScriptEditor.cp.cmap := Palette;
|
||||||
ScriptEditor.cp.name := FileList[index];
|
ScriptEditor.cp.name := FileList[index];
|
||||||
finally
|
finally
|
||||||
@ -1892,7 +1891,6 @@ begin
|
|||||||
if NumTransforms > 1 then
|
if NumTransforms > 1 then
|
||||||
begin
|
begin
|
||||||
AMachine.Paused := True;
|
AMachine.Paused := True;
|
||||||
// --?-- ScriptEditor.cp.NormalizeWeights;
|
|
||||||
PreviewForm.cp.Copy(ScriptEditor.cp);
|
PreviewForm.cp.Copy(ScriptEditor.cp);
|
||||||
PreviewForm.cp.AdjustScale(PreviewForm.Image.Width, PreviewForm.Image.Height);
|
PreviewForm.cp.AdjustScale(PreviewForm.Image.Width, PreviewForm.Image.Height);
|
||||||
PreviewForm.Show;
|
PreviewForm.Show;
|
||||||
@ -1907,7 +1905,6 @@ procedure TOperationLibrary.RenderProc(AMachine: TatVirtualMachine);
|
|||||||
begin
|
begin
|
||||||
if NumTransforms > 1 then
|
if NumTransforms > 1 then
|
||||||
begin
|
begin
|
||||||
// --?-- ScriptEditor.cp.NormalizeWeights;
|
|
||||||
ScriptRenderForm.cp.Copy(ScriptEditor.cp);
|
ScriptRenderForm.cp.Copy(ScriptEditor.cp);
|
||||||
ScriptRenderForm.Caption := 'Rendering ' + ScriptEditor.Renderer.Filename; ;
|
ScriptRenderForm.Caption := 'Rendering ' + ScriptEditor.Renderer.Filename; ;
|
||||||
ScriptRenderForm.Show;
|
ScriptRenderForm.Show;
|
||||||
@ -2052,7 +2049,8 @@ end;
|
|||||||
procedure TOperationLibrary.TranslateProc(AMachine: TatVirtualMachine);
|
procedure TOperationLibrary.TranslateProc(AMachine: TatVirtualMachine);
|
||||||
begin
|
begin
|
||||||
try
|
try
|
||||||
if (ActiveTransform < 0) or (ActiveTransform > NXFORMS - 1) then raise EFormatInvalid.Create('Transform out of range.');
|
if (ActiveTransform < 0) or (ActiveTransform > NXFORMS) then // was: NXFORMS-1
|
||||||
|
raise EFormatInvalid.Create('Transform out of range.');
|
||||||
with AMachine do
|
with AMachine do
|
||||||
ScriptEditor.cp.xform[ActiveTransform].Translate(GetInputArgAsFloat(0), GetInputArgAsFloat(1));
|
ScriptEditor.cp.xform[ActiveTransform].Translate(GetInputArgAsFloat(0), GetInputArgAsFloat(1));
|
||||||
except on E: EFormatInvalid do
|
except on E: EFormatInvalid do
|
||||||
@ -2437,6 +2435,18 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TScriptEditor.GetFlameFinalxformEnabledProc(AMachine: TatVirtualMachine);
|
||||||
|
begin
|
||||||
|
with AMachine do
|
||||||
|
ReturnOutPutArg(cp.finalXformEnabled);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TScriptEditor.SetFlameFinalxformEnabledProc(AMachine: TatVirtualMachine);
|
||||||
|
begin
|
||||||
|
with AMachine do
|
||||||
|
cp.finalXformEnabled := (GetInputArgAsInteger(0) <> 0);
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TScriptEditor.GetFlameWidthProc(AMachine: TatVirtualMachine);
|
procedure TScriptEditor.GetFlameWidthProc(AMachine: TatVirtualMachine);
|
||||||
begin
|
begin
|
||||||
with AMachine do
|
with AMachine do
|
||||||
@ -2474,13 +2484,15 @@ end;
|
|||||||
procedure TScriptEditor.GetFlamePixelsPerUnitProc(AMachine: TatVirtualMachine);
|
procedure TScriptEditor.GetFlamePixelsPerUnitProc(AMachine: TatVirtualMachine);
|
||||||
begin
|
begin
|
||||||
with AMachine do
|
with AMachine do
|
||||||
ReturnOutPutArg(cp.pixels_per_unit);
|
// ReturnOutPutArg(cp.pixels_per_unit);
|
||||||
|
ReturnOutPutArg(100*cp.pixels_per_unit/cp.Width);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TScriptEditor.SetFlamePixelsPerUnitProc(AMachine: TatVirtualMachine);
|
procedure TScriptEditor.SetFlamePixelsPerUnitProc(AMachine: TatVirtualMachine);
|
||||||
begin
|
begin
|
||||||
with AMachine do
|
with AMachine do
|
||||||
cp.pixels_per_unit := GetInputArgAsInteger(0);
|
// cp.pixels_per_unit := GetInputArgAsInteger(0); <<--- hmm, ppu isn't integer :-\
|
||||||
|
cp.pixels_per_unit := GetInputArgAsFloat(0) * cp.Width / 100.0;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TScriptEditor.GetFlamePaletteProc(AMachine: TatVirtualMachine);
|
procedure TScriptEditor.GetFlamePaletteProc(AMachine: TatVirtualMachine);
|
||||||
@ -2975,6 +2987,7 @@ begin
|
|||||||
DefineProp('URL', tkString, GetFlameURLProc, SetFlameURLProc);
|
DefineProp('URL', tkString, GetFlameURLProc, SetFlameURLProc);
|
||||||
DefineProp('Hue', tkFloat, GetFlameHueProc, SetFlameHueProc);
|
DefineProp('Hue', tkFloat, GetFlameHueProc, SetFlameHueProc);
|
||||||
DefineProp('Batches', tkInteger, GetFlameBatchesProc, SetFlameBatchesProc);
|
DefineProp('Batches', tkInteger, GetFlameBatchesProc, SetFlameBatchesProc);
|
||||||
|
DefineProp('FinalXformEnabled', tkInteger, GetFlameFinalxformEnabledProc, SetFlameFinalxformEnabledProc);
|
||||||
end;
|
end;
|
||||||
Scripter.AddObject('Flame', Flame);
|
Scripter.AddObject('Flame', Flame);
|
||||||
{ Transform interface }
|
{ Transform interface }
|
||||||
@ -3326,7 +3339,6 @@ begin
|
|||||||
else
|
else
|
||||||
if (LastError = '') and UpdateIt then
|
if (LastError = '') and UpdateIt then
|
||||||
begin
|
begin
|
||||||
// --?-- cp.NormalizeWeights;
|
|
||||||
MainForm.UpdateUndo;
|
MainForm.UpdateUndo;
|
||||||
MainCp.Copy(cp);
|
MainCp.Copy(cp);
|
||||||
UpdateFlame;
|
UpdateFlame;
|
||||||
@ -3358,7 +3370,6 @@ procedure TScriptEditor.UpdateFlame;
|
|||||||
begin
|
begin
|
||||||
MainForm.StopThread;
|
MainForm.StopThread;
|
||||||
MainForm.UpdateUndo;
|
MainForm.UpdateUndo;
|
||||||
// --?-- cp.NormalizeWeights;
|
|
||||||
MainCp.Copy(cp);
|
MainCp.Copy(cp);
|
||||||
// MainCp.name := FlameName;
|
// MainCp.name := FlameName;
|
||||||
Transforms := MainCp.TrianglesFromCP(MainTriangles);
|
Transforms := MainCp.TrianglesFromCP(MainTriangles);
|
||||||
|
Loading…
Reference in New Issue
Block a user