修复进度回调done值错误
This commit is contained in:
@@ -24,7 +24,7 @@ namespace Spine.Exporters
|
|||||||
int frameCount = GetFrameCount();
|
int frameCount = GetFrameCount();
|
||||||
int frameIdx = 0;
|
int frameIdx = 0;
|
||||||
|
|
||||||
_progressReporter?.Invoke(frameCount, 0, $"[{frameIdx}/{frameCount}] {output}"); // 导出帧序列单独在此处调用进度报告
|
_progressReporter?.Invoke(frameCount, 0, $"[0/{frameCount}] {output}"); // 导出帧序列单独在此处调用进度报告
|
||||||
foreach (var frame in GetFrames(spines))
|
foreach (var frame in GetFrames(spines))
|
||||||
{
|
{
|
||||||
if (ct.IsCancellationRequested)
|
if (ct.IsCancellationRequested)
|
||||||
@@ -37,7 +37,7 @@ namespace Spine.Exporters
|
|||||||
var savePath = Path.Combine(output, $"frame_{_fps}_{frameIdx:d6}.png");
|
var savePath = Path.Combine(output, $"frame_{_fps}_{frameIdx:d6}.png");
|
||||||
var info = new SKImageInfo(frame.Width, frame.Height, SKColorType.Rgba8888, SKAlphaType.Premul);
|
var info = new SKImageInfo(frame.Width, frame.Height, SKColorType.Rgba8888, SKAlphaType.Premul);
|
||||||
|
|
||||||
_progressReporter?.Invoke(frameCount, frameIdx, $"[{frameIdx + 1}/{frameCount}] {savePath}");
|
_progressReporter?.Invoke(frameCount, frameIdx + 1, $"[{frameIdx + 1}/{frameCount}] {savePath}");
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
using var skImage = SKImage.FromPixelCopy(info, frame.Image.Pixels);
|
using var skImage = SKImage.FromPixelCopy(info, frame.Image.Pixels);
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ namespace Spine.Exporters
|
|||||||
int frameCount = GetFrameCount();
|
int frameCount = GetFrameCount();
|
||||||
int frameIdx = 0;
|
int frameIdx = 0;
|
||||||
|
|
||||||
_progressReporter?.Invoke(frameCount, 0, $"[{frameIdx}/{frameCount}] {output}");
|
_progressReporter?.Invoke(frameCount, 0, $"[0/{frameCount}] {output}");
|
||||||
foreach (var frame in GetFrames(spines))
|
foreach (var frame in GetFrames(spines))
|
||||||
{
|
{
|
||||||
if (ct.IsCancellationRequested)
|
if (ct.IsCancellationRequested)
|
||||||
@@ -138,7 +138,7 @@ namespace Spine.Exporters
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
_progressReporter?.Invoke(frameCount, frameIdx, $"[{frameIdx + 1}/{frameCount}] {output}");
|
_progressReporter?.Invoke(frameCount, frameIdx + 1, $"[{frameIdx + 1}/{frameCount}] {output}");
|
||||||
yield return frame;
|
yield return frame;
|
||||||
frameIdx++;
|
frameIdx++;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user