diff --git a/SpineViewer/Exporter/Implementations/ExportArgs/VideoExportArgs.cs b/SpineViewer/Exporter/Implementations/ExportArgs/VideoExportArgs.cs index 8d1f685..0d44007 100644 --- a/SpineViewer/Exporter/Implementations/ExportArgs/VideoExportArgs.cs +++ b/SpineViewer/Exporter/Implementations/ExportArgs/VideoExportArgs.cs @@ -19,7 +19,7 @@ namespace SpineViewer.Exporter.Implementations.ExportArgs /// /// 导出时长 /// - [Category("[1] 视频参数"), DisplayName("时长"), Description("可以从模型列表查看动画时长, 如果小于 0, 则在逐个导出时每个模型使用各自的当前动画时长")] + [Category("[1] 视频参数"), DisplayName("时长"), Description("可以从模型列表查看动画时长, 如果小于 0, 则在逐个导出时每个模型使用各自的所有轨道动画时长最大值")] public float Duration { get => duration; diff --git a/SpineViewer/Exporter/Implementations/Exporter/VideoExporter.cs b/SpineViewer/Exporter/Implementations/Exporter/VideoExporter.cs index 0cfda8f..aa6e273 100644 --- a/SpineViewer/Exporter/Implementations/Exporter/VideoExporter.cs +++ b/SpineViewer/Exporter/Implementations/Exporter/VideoExporter.cs @@ -23,9 +23,9 @@ namespace SpineViewer.Exporter.Implementations.Exporter { var args = (VideoExportArgs)ExportArgs; - // 独立导出时如果 args.Duration 小于 0 则使用 Track0 的动画时长 + // 独立导出时如果 args.Duration 小于 0 则使用所有轨道上动画时长最大值 var duration = args.Duration; - if (duration < 0) duration = spine.GetAnimationDuration(spine.Track0Animation); // TODO: 也许可以使用所有轨道的最大值 + if (duration < 0) duration = spine.GetTrackIndices().Select(i => spine.GetAnimationDuration(spine.GetAnimation(i))).Max(); float delta = 1f / args.FPS; int total = Math.Max(1, (int)(duration * args.FPS)); // 至少导出 1 帧 @@ -75,7 +75,7 @@ namespace SpineViewer.Exporter.Implementations.Exporter public override void Export(Spine.Spine[] spines, BackgroundWorker? worker = null) { // 导出视频格式需要把模型时间都重置到 0 - foreach (var spine in spines) spine.Track0Animation = spine.Track0Animation; // TODO: 多轨道重置 + foreach (var spine in spines) spine.ResetAnimationsTime(); base.Export(spines, worker); } }