From 8e035eac589aafceafa083c6ad213d81b33e9f2f Mon Sep 17 00:00:00 2001 From: zueuk Date: Sat, 9 Dec 2006 13:37:51 +0000 Subject: [PATCH] new function: VariationName(index) --- 2.10/Source/ScriptForm.pas | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/2.10/Source/ScriptForm.pas b/2.10/Source/ScriptForm.pas index 48f82e5..b135e12 100644 --- a/2.10/Source/ScriptForm.pas +++ b/2.10/Source/ScriptForm.pas @@ -401,6 +401,7 @@ type procedure SetVariableStr(AMachine: TatVirtualMachine); } procedure VariationIndexProc(AMachine: TatVirtualMachine); + procedure VariationNameProc(AMachine: TatVirtualMachine); procedure GetPivotModeProc(AMachine: TatVirtualMachine); procedure SetPivotModeProc(AMachine: TatVirtualMachine); procedure GetPivotXProc(AMachine: TatVirtualMachine); @@ -1221,6 +1222,7 @@ begin } Scripter.AddConstant('ProgramVersionString', AppVersionString); Scripter.DefineMethod('VariationIndex', 1, tkInteger, nil, VariationIndexProc); + Scripter.DefineMethod('VariationName', 1, tkString, nil, VariationNameProc); Scripter.DefineMethod('GetPivotMode', 0, tkInteger, nil, GetPivotModeProc); Scripter.DefineMethod('SetPivotMode', 1, tkNone, nil, SetPivotModeProc); @@ -1851,6 +1853,20 @@ begin end; end; +procedure TOperationLibrary.VariationNameProc(AMachine: TatVirtualMachine); +var + i: integer; + str: string; +begin + with AMachine do begin + i := GetInputArgAsInteger(0); + if (i >= 0) and (i < NRVAR) then + ReturnOutputArg(varnames(i)) + else + ReturnOutputArg(''); + end; +end; + procedure TOperationLibrary.FileCountProc(AMachine: TatVirtualMachine); begin with AMachine do @@ -2700,7 +2716,7 @@ begin with AMachine do begin v := GetInputArgAsFloat(0); - if (v > 0) and (v < 256) then + if (v > 0) and (v <= MAX_WEIGHT) then cp.xform[ActiveTransform].density := v; end; end; @@ -2867,7 +2883,10 @@ end; procedure TScriptEditor.TransformClearProc(AMachine: TatVirtualMachine); begin cp.xform[ActiveTransform].Clear; - cp.xform[ActiveTransform].density := 0.5; + if ActiveTransform < Transforms then + cp.xform[ActiveTransform].density := 0.5 + else + cp.xform[ActiveTransform].symmetry := 1; end; procedure TScriptEditor.TransformRotateOriginProc(AMachine: TatVirtualMachine);