Merge pull request #132 from jayng9663/dev/wpf

Add --warmup option to control physics warmup loops
This commit is contained in:
ww-rm
2025-10-24 23:07:13 +08:00
committed by GitHub

View File

@@ -33,6 +33,7 @@ options:
--speed FLOAT Speed of animation (for video), default 1.0
--color HEX Background color as a hex RGBA color, default 000000ff (opaque black)
--quiet Removes console progress log, default false
--warmup INT Warm Up Physics, default 2 loops before export
";
public static void Main(string[] args)
@@ -57,6 +58,8 @@ options:
float speed = 1;
Color backgroundColor = Color.Black;
bool quiet = false;
bool warmup = false;
int warmUpLoops = 2;
for (int i = 0; i < args.Length; i++)
{
@@ -126,6 +129,10 @@ options:
case "--quiet":
quiet = true;
break;
case "--warmup":
warmUpLoops = int.Parse(args[++i]);
warmup = true;
break;
default:
Console.Error.WriteLine($"Unknown argument: {args[i]}");
Environment.Exit(2);
@@ -172,6 +179,11 @@ options:
}
sp.Update(0);
if (warmup)
{
sp.Update(trackEntry.Animation.Duration * warmUpLoops);
}
foreach (var slotName in hideSlots)
{
if (!sp.SetSlotVisible(slotName, false))
@@ -349,4 +361,4 @@ options:
return new(x, y, w, h);
}
}
}
}